@Test public void publish_respects_communication_ports() throws Exception { int cnt = 5; for (int i = 0; i < cnt; i++) { TService ts = new TService(); ts.m_val = i; String pp = RmiCommunicationPorts.class.getName(); int rnd = 14000 + RandomUtils.nextInt(2000); System.setProperty(pp + ".min-port", "" + rnd); System.setProperty(pp + ".max-port", "" + (rnd + 5)); int p = RmiServerPublisher.publish_service(TServiceI.class, ts); assertEquals(rnd, p); Client c = new Client("localhost", rnd); Object obj = c.lookup(TServiceI.class); assertNotNull(obj); assertTrue(obj instanceof TServiceI); } }
public static int publish_service(Class<?> cls, Object obj) throws RmiCommException { return publish_service(cls, obj, 0); }
RmiServerPublisher { public static int publish_service(Class<?> cls, Object obj) throws RmiCommException { return publish_service(cls, obj, 0); } }
RmiServerPublisher { public static int publish_service(Class<?> cls, Object obj) throws RmiCommException { return publish_service(cls, obj, 0); }  }
RmiServerPublisher { public static int publish_service(Class<?> cls, Object obj) throws RmiCommException { return publish_service(cls, obj, 0); }  static int publish_service(Class<?> cls, Object obj); static int publish_service(Class<?> cls, Object obj, int port); static void shutdown_all(); }
RmiServerPublisher { public static int publish_service(Class<?> cls, Object obj) throws RmiCommException { return publish_service(cls, obj, 0); }  static int publish_service(Class<?> cls, Object obj); static int publish_service(Class<?> cls, Object obj, int port); static void shutdown_all();  }