@BeforeClass public static void startServer() throws Exception { EmbeddedServerFactory.setupCleanDirectories(System.getProperties()); ServerEnvironment serverEnvironment = Main.determineEnvironment( new String[0], new Properties(System.getProperties()), System.getenv()); Assert.assertNotNull(serverEnvironment); final Bootstrap bootstrap = Bootstrap.Factory.newInstance(); final Bootstrap.Configuration configuration = new Bootstrap.Configuration(); configuration.setServerEnvironment(serverEnvironment); configuration.setModuleLoader(Module.getBootModuleLoader()); configuration.setPortOffset(0); container = bootstrap.startup(configuration, Collections.<ServiceActivator>emptyList()).get(); Assert.assertNotNull(container); }