/** * Looks up a TestRunnerFacade using a remote JNDI service locator, configured by JU property files. * @return TestRunnerFacade instance */ public static synchronized TestRunnerFacade getTestRunnerFacade() { if (testRunnerFacade == null) { testRunnerFacade = getRemoteServiceLocator().lookup(TestRunnerFacade.class); } return testRunnerFacade; } }
/** * Looks up a TestRunnerFacade using a remote JNDI service locator, configured by JU property files. * @return TestRunnerFacade instance */ public static synchronized TestRunnerFacade getTestRunnerFacade() { if (testRunnerFacade == null) { testRunnerFacade = getRemoteServiceLocator().lookup(TestRunnerFacade.class); } return testRunnerFacade; } }
@Test public void canLookup_testFacadeBean_usingServiceLocatorBuilder() throws Exception { JndiServiceLocator loc = ServiceLocatorBuilder.buildRemote() .remoteServer("localhost", 18080) .appName("") .moduleName("test") .createServiceLocator(); // TestRemote testRemote = loc.lookup(TestRemote.class); TestRemote testRemote = loc.lookup("TestRemoteInterfaceBean!" + TestRemote.class.getName()); Assert.assertEquals("TestRemoteBean says hello to ServiceLocatorBuilder", testRemote.getGreeting("ServiceLocatorBuilder")); } }
@Test public void canLookup_testFacadeBean_usingServiceLocatorBuilder() throws Exception { JndiServiceLocator loc = ServiceLocatorBuilder.buildRemote() .remoteServer("localhost", 18080) .appName("") .moduleName("test") .createServiceLocator(); // TestRemote testRemote = loc.lookup(TestRemote.class); TestRemote testRemote = loc.lookup("TestRemoteInterfaceBean!" + TestRemote.class.getName()); Assert.assertEquals("TestRemoteBean says hello to ServiceLocatorBuilder", testRemote.getGreeting("ServiceLocatorBuilder")); } }