Skip to main content

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 07:21 Go to next message
Dusan Sarvan is currently offline Dusan SarvanFriend
Messages: 1
Registered: October 2013
Junior Member

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,

Re: JUnit test for the Scout Search Form [message #1151607 is a reply to message #1151190] Wed, 23 October 2013 13:18 Go to previous messageGo to next message
Matthias Nick is currently offline Matthias NickFriend
Messages: 197
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

Re: JUnit test for the Scout Search Form [message #1151830 is a reply to message #1151607] Wed, 23 October 2013 16:31 Go to previous message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
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: Fri Jul 10 10:55:23 GMT 2020

Powered by FUDForum. Page generated in 0.08276 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top