// CalledHome EJB is contained in cross-server.jar and bound during deployment
// lookup binding locally on Node0 - should succeed
Context naming = getContext(NODE0_JNDI);
CalledHome home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
if (home != null)
{ // ensure that EJB is operational
CalledRemote remote = home.create();
remote.remove();
}
closeContext(naming);
assertNotNull("lookup EJB binding on same server using local JNDI", home);
// lookup binding locally on Node1 - should succeed
naming = getContext(NODE1_JNDI);
home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
if (home != null)
{ // ensure that EJB is operational
CalledRemote remote = home.create();
remote.remove();
}
closeContext(naming);
assertNotNull("lookup EJB binding on different server in cluster using local JNDI", home);
// lookup binding using HA-JNDI on Node0 - should succeed
naming = getContext(NODE0_HAJNDI);
home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
if (home != null)
{ // ensure that EJB is operational
CalledRemote remote = home.create();
remote.remove();
}
closeContext(naming);
assertNotNull("lookup EJB binding on same server using HA-JNDI", home);
// lookup binding using HA-JNDI on Node1 - should succeed
naming = getContext(NODE1_HAJNDI);
home = (CalledHome)lookup(naming, CALLED_HOME_KEY, true);
if (home != null)
{ // ensure that EJB is operational
CalledRemote remote = home.create();
remote.remove();
}
closeContext(naming);
assertNotNull("lookup EJB binding on different server in cluster using HA-JNDI", home);