background image
<< Stubs | Generating Stubs >>
<< Stubs | Generating Stubs >>

Sample Application

Stubs
19
In a stub, any method that is called by the component-under-test requires a lookup
table consisting of rows and columns of expected results and exceptions for the
method, as in the following example. (Although the lookup table is generated
automatically when you generate the stub, you must use the datapool manager to
populate the lookup table.)
gets data from
Sample Application
Lookup Table
Test Environment
calls
ManageAccounts EJB Stub
getSavingsBalance
ExecuteTransaction EJB
getBalance method
component-under-test
getCustomerSavingsID
tests
w
h
ic
h ca
lls
1
ExecuteTransaction EJB
deleteAllAccounts method
deposit()
getBalance()
.
.
withdraw()
getBalance Test Script
ManageAccounts EJB
getSavingsBalance method
getCustomerSavingsID method
AccountID
expectedReturn expectedException
012 34 5678
012 34 5678
123 45 6789
123 45 6789
234 56 7890
java.rmi.RemoteException