props.put(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName());
String port = System.getProperty("server.http.port");
if (port != null) {
props.put(Context.PROVIDER_URL, options.get(Context.PROVIDER_URL,"http://localhost:" + port + "/tomee/ejb"));
} else {
throw new OpenEJBTCKRuntimeException("Please set the tomee port as a system property");
}
final String deployerJndi = System.getProperty("openejb.deployer.jndiname", "openejb/DeployerBusinessRemote");
try {
InitialContext context = new InitialContext(props);
return (Deployer) context.lookup(deployerJndi);
} catch (Exception e) {
throw new OpenEJBTCKRuntimeException(e);
}
}