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?