public class AddressBookTest extends TestCase {
@Control
public EnhancedAddressBook client;
public void testGetAddressFromName() throws Exception {
Address address = Address.Factory.newInstance();
address.setStreetName("Open Source Way");
address.setCity("Seattle");
address.setZip(98119);
Phone phone = Phone.Factory.newInstance();
phone.setAreaCode(206);
phone.setNumber("111-2222");
address.setPhoneNumber(phone);
StateType state = StateType.Factory.newInstance();
state.setState("WA");
address.setState(state);
client.addEntry("apache", address);
// retrieve the address
Address response = client.getAddressFromName("apache");
assertTrue(response.getStreetName().equals("Open Source Way"));
// more assertions here..
}