use of com.hubspot.singularity.scheduler.SingularityTestModule in project Singularity by HubSpot.
the class SingularityCuratorTestBase method curatorSetup.
@Before
public final void curatorSetup() throws Exception {
JerseyGuiceUtils.reset();
singularityTestModule = new SingularityTestModule(useDBTests, customConfigSetup);
singularityTestModule.getInjector().injectMembers(this);
singularityTestModule.start();
}
use of com.hubspot.singularity.scheduler.SingularityTestModule in project Singularity by HubSpot.
the class SingularityCuratorTestBase method setup.
@BeforeAll
public synchronized void setup() throws Exception {
JerseyGuiceUtils.reset();
singularityTestModule = new SingularityTestModule(useDBTests, customConfigSetup);
singularityTestModule.getInjector().injectMembers(this);
singularityTestModule.start();
leaderCacheCoordinator.activateLeaderCache();
configuration.setThreadpoolShutdownDelayInSeconds(0);
if (useDBTests) {
Handle handle = dbiProvider.get().open();
handle.getConnection().setAutoCommit(true);
Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(handle.getConnection()));
Liquibase liquibase = new Liquibase("singularity_test.sql", new FileSystemResourceAccessor(), database);
liquibase.update((String) null);
try {
database.close();
handle.close();
} catch (Throwable t) {
}
}
}
Aggregations