// Lookup JNDI Binding Test EJB at Location 1, and invoke
Object location1 = context.lookup(RemoteJndiBindingTest.JNDI_BINDING_1);
TestCase.assertNotNull("Expected remote binding in JNDI at " + RemoteJndiBindingTest.JNDI_BINDING_1
+ " was not found", location1);
TestCase.assertTrue(location1 instanceof BindingTest);
BindingTest test1 = (BindingTest) location1;
String result1 = test1.echo(testMessage);
TestCase.assertEquals(testMessage, result1);
// Lookup JNDI Binding Test EJB at Location 2, and invoke
Object location2 = context.lookup(RemoteJndiBindingTest.JNDI_BINDING_2);
TestCase.assertNotNull("Expected remote binding in JNDI at " + RemoteJndiBindingTest.JNDI_BINDING_2
+ " was not found", location2);
TestCase.assertTrue(location2 instanceof BindingTest);
BindingTest test2 = (BindingTest) location2;
String result2 = test2.echo(testMessage);
TestCase.assertEquals(testMessage, result2);
// Lookup JNDI Binding Test EJB at Location 3, and invoke
Object location3 = context.lookup(RemoteJndiBindingTest.JNDI_BINDING_DECLARED_BY_BUSINESS_INTERFACE);
TestCase.assertNotNull("Expected remote binding in JNDI at "
+ RemoteJndiBindingTest.JNDI_BINDING_DECLARED_BY_BUSINESS_INTERFACE + " was not found", location2);
TestCase.assertTrue(location3 instanceof BindingTest);
BindingTest test3 = (BindingTest) location3;
String result3 = test3.echo(testMessage);
TestCase.assertEquals(testMessage, result3);
// Unbind and test
this.unbindAndTest(context, this.sessionContainer);
}