ejbJar.addEnterpriseBean(new StatelessBean(Target.class));
assembler.createApplication(config.configureApplication(ejbJar));
SystemInstance.get().setComponent(DiscoveryAgent.class, agent);
final ServerService red = server(Host.RED);
final ServerService blue = server(Host.BLUE);
final ServerService green = server(Host.GREEN);
red.start();
blue.start();
green.start();
final TargetRemote target = getBean(red);
assertEquals(Host.RED, target.getHost());
red.stop();
assertEquals(Host.BLUE, target.getHost());
blue.stop();
assertEquals(Host.GREEN, target.getHost());
green.stop();
try {
target.getHost();
fail("EJBException should have been thrown");
} catch (EJBException e) {