testing clinet server applications with swing user interface
1 posts in topic
Flat View  Flat View

Posted By:   shiva_k
Posted On:   Monday, February 23, 2004 02:27 AM

How can I use junit to test swing client applications which need to interact with the applications server?

Re: testing clinet server applications with swing user interface

Posted By:   Anonymous  
Posted On:   Tuesday, February 24, 2004 01:52 PM

Basically, JUnit is a *unit* testing framework - that is, you use it to test *small units* *in isolation*.

In your example, the classes on the client which contain business logic should know about neither Swing nor the application server. Those units would be tested like in any other application. If those classes need to speak to the server and/or GUI, they should do so through an abstraction layer, which for the tests can be replaced by test-implementations. For example, if you apply the MVC or MVP pattern, a test could listen to the model wether a registered view would receive the correct events. Similarly, tests could provide the model with a fake implementation of the application server layer, providing it the needed test data.

Does that help?

About | Sitemap | Contact