Search in sources :

Example 1 with MySqlGlobalLocker

use of org.killbill.commons.locker.mysql.MySqlGlobalLocker in project killbill by killbill.

the class UtilTestSuiteWithEmbeddedDB method beforeClass.

@BeforeClass(groups = "slow")
public void beforeClass() throws Exception {
    final Injector g = Guice.createInjector(Stage.PRODUCTION, new TestUtilModuleWithEmbeddedDB(configSource));
    g.injectMembers(this);
    if (DBEngine.MYSQL.equals(helper.getDBEngine())) {
        Assert.assertTrue(locker instanceof MySqlGlobalLocker);
    } else if (DBEngine.POSTGRESQL.equals(helper.getDBEngine())) {
        Assert.assertTrue(locker instanceof PostgreSQLGlobalLocker);
    } else {
        Assert.assertTrue(locker instanceof MemoryGlobalLocker);
    }
    Assert.assertTrue(locker.isFree("a", "b"));
}
Also used : TestUtilModuleWithEmbeddedDB(org.killbill.billing.util.glue.TestUtilModuleWithEmbeddedDB) MemoryGlobalLocker(org.killbill.commons.locker.memory.MemoryGlobalLocker) Injector(com.google.inject.Injector) PostgreSQLGlobalLocker(org.killbill.commons.locker.postgresql.PostgreSQLGlobalLocker) MySqlGlobalLocker(org.killbill.commons.locker.mysql.MySqlGlobalLocker) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

Injector (com.google.inject.Injector)1 TestUtilModuleWithEmbeddedDB (org.killbill.billing.util.glue.TestUtilModuleWithEmbeddedDB)1 MemoryGlobalLocker (org.killbill.commons.locker.memory.MemoryGlobalLocker)1 MySqlGlobalLocker (org.killbill.commons.locker.mysql.MySqlGlobalLocker)1 PostgreSQLGlobalLocker (org.killbill.commons.locker.postgresql.PostgreSQLGlobalLocker)1 BeforeClass (org.testng.annotations.BeforeClass)1