4.6. Testing the EJB

Executing the test client will fully test the EJB, as it only has two methods. The important thing to note when running the test client is that the CLASSPATH must allow the JVM to find the stubs that were generated by the deployment tool.

To run the test client from the command line on a Unix system, we need a command like this:

% cd [root] 
% java -classpath $CLASSPATH:target/shared/:\ 
target/testclient/:interestClient.jar \ 
com/kevinboone/ejb_book/interest/InterestTestClient 

or on a Windows system:

c:\> cd [root] 
C:\> java -classpath %CLASSPATH%;target\shared;\ 
target\testclient;interestClient.jar \ 
com\kevinboone\ejb_book\interest\InterestTestClient 

As before, the notation [root] means the source root directory, whatever ...

Get Applied Enterprise JavaBeans™ Technology now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.