use of org.apache.openejb.server.ServiceFinder in project tomee by apache.
the class DerbyNetworkServiceTest method test.
@Test
public void test() throws Exception {
final int port = NetworkUtil.getNextAvailablePort();
final SimpleServiceManager serviceManager = new SimpleServiceManager(new ServiceFinder() {
@Override
public Map<String, Properties> mapAvailableServices(Class interfase) throws IOException, ClassNotFoundException {
final Properties properties = new Properties();
properties.setProperty("server", DerbyNetworkService.class.getName());
properties.setProperty("port", port + "");
properties.setProperty("disabled", "false");
properties.put(ServerService.class, DerbyNetworkService.class);
properties.put("derby.system.home", new File(SystemInstance.get().getBase().getDirectory(), "target").getAbsolutePath());
final Map<String, Properties> services = new HashMap<String, Properties>();
services.put("derbynet", properties);
return services;
}
});
serviceManager.init();
serviceManager.start(false);
waitForDerby(port);
assertConnection(port);
serviceManager.stop();
}
Aggregations