Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » JUnit test for the Scout Search Form
JUnit test for the Scout Search Form [message #1151190] Wed, 23 October 2013 03:21 Go to next message
Dusan Sarvan is currently offline Dusan Sarvan
Messages: 1
Registered: October 2013
Junior Member
Hi,

I am using Eclipse Scout Version: 4.3.0. In order to test a presentation functionality on a Form level I have created a test case. Here is a short description of my JUnit test case:
1. Create instances of the Form and FormData classes
2. Add some search data in the FormData instance
3. Export FormData
4. Call the service on the Scout Server side
5. Import FormData and verify some response data received in the FormData

By running a JUnit test I got the NullPointerException. It seems that in my test case I have to create Desktop and DesktopExtension instances as well and to add the form to the DesktopExtension.

I appreciate if somebody can help me about this issue, or any example for testing Forms by JUnit.

Kind regards,

Dusan.
Re: JUnit test for the Scout Search Form [message #1151607 is a reply to message #1151190] Wed, 23 October 2013 09:18 Go to previous messageGo to next message
Matthias Nick is currently offline Matthias Nick
Messages: 148
Registered: August 2013
Senior Member
Hi Dusan,

thanks for your post. Can you please post the complete stacktrace? This will help us to help you Smile

Greetings
Matthias
Re: JUnit test for the Scout Search Form [message #1151830 is a reply to message #1151607] Wed, 23 October 2013 12:31 Go to previous message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 635
Registered: October 2011
Senior Member
I assume you get the NullPointerException on the call SERVICES.getService(..). This is because JUnit tests needs to run inside a Scout Session.

You might find some inputs in my presentation: Testing a Scout Application with JUnit (EclipseCon Boston 2013) and in the corresponding blog post.

We have a running demo app that contains some tests: Minifig Application

Have a look, do not hesitate to ask. This is something we need to document better.
Previous Topic:LoginDialog example
Next Topic:MySql trouble with SearchForm
Goto Forum:
  


Current Time: Mon Jul 28 20:33:17 EDT 2014

Powered by FUDForum. Page generated in 0.11453 seconds