if (injector == null) {
configuration = conf;
configuration.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder("data").getAbsolutePath());
configuration.set(Constants.AppFabric.REST_PORT, Integer.toString(Networks.getRandomPort()));
configuration.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET, true);
injector = Guice.createInjector(new AppFabricTestModule(configuration));
injector.getInstance(TransactionManager.class).startAndWait();
injector.getInstance(DatasetOpExecutor.class).startAndWait();
injector.getInstance(DatasetService.class).startAndWait();
injector.getInstance(SchedulerService.class).startAndWait();
}