-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This project illustrates a way to perform integration testing on GUI applications. The service layer is mocked using Easymock. Thus, we define use-cases in TestFx by mocking the service layer. Our test suite is organized in such a way that our future service implementation will inherit of the planned test defined intially with mocks.
Our service is a very simple service whose goal is to handle a set of users. It is composed of one interface UserService and an abstract class User. We add also a factory ServiceFactory. A user has a last name and a first name.
This application is really minimalist. The menu is composed of two buttons (Menu): Delete a user and quit. Clicking on Delete a user leads you toward a lovely pane (UserList) composed of a listview (ListView) and two buttons (delete a user and menu).
Basically, like in any MVC application, the controller has its orchestral role.
In the class MainTest, one can denote two basic storylines:
- a user runs the application, click on delete a user, select a user in the listview, click on the delete button and finally cancel his action. The class StoryLineSelectAUserAndCancel explicitly defines what we expect about an instance of the class UserService in this storyline.
- a user runs the application, click on delete a user, select a user in the listview, click on the delete button and finally confirm his action. The class StoryLineSelectAUserAndConfirm explicitly defines what we expect about an instance of the class UserService in this storyline.
In the package mock, it corresponds to an initialization of the used mock.