@Override protected PlatformDBTestingHelper getPlatformDBTestingHelper() { return DBTestingHelper.get(); }
@BeforeMethod(groups = "slow") public void cleanupTablesBetweenMethods() { try { DBTestingHelper.get().getInstance().cleanupAllTables(); } catch (final Exception ignored) { } }
protected void cleanupAllTables() { try { DBTestingHelper.get().getInstance().cleanupAllTables(); } catch (final Exception e) { Assert.fail("Unable to clean database", e); } }
@BeforeSuite(groups = "slow") public void beforeSuite() throws Exception { // Hack to configure log4jdbc -- properties used by tests will be properly setup in @BeforeClass getConfigSource(ImmutableMap.<String, String>of()); DBTestingHelper.get().start(); }
@AfterSuite(groups = "slow") public void shutdownMysqlAfterTestSuite() throws IOException, ClassNotFoundException, SQLException, URISyntaxException { if (hasFailed()) { log.error("**********************************************************************************************"); log.error("*** TESTS HAVE FAILED - LEAVING DB RUNNING FOR DEBUGGING - MAKE SURE TO KILL IT ONCE DONE ****"); log.error(DBTestingHelper.get().getInstance().getCmdLineConnectionString()); log.error("**********************************************************************************************"); return; } try { DBTestingHelper.get().getInstance().stop(); } catch (final Exception ignored) { } } }
@BeforeSuite(groups = "slow") public void startMysqlBeforeTestSuite() throws IOException, ClassNotFoundException, SQLException, URISyntaxException { DBTestingHelper.get().start(); }
final EmbeddedDB embeddedDB = DBTestingHelper.get().getInstance(); final List<String> tables = embeddedDB.getAllTables();
@Override protected PlatformDBTestingHelper getPlatformDBTestingHelper() { return DBTestingHelper.get(); }
@AfterSuite(groups = "slow") public void afterSuite() throws Exception { if (hasFailed()) { threadDump(); dumpDB(); log.error("**********************************************************************************************"); log.error("*** TESTS HAVE FAILED - LEAVING DB RUNNING FOR DEBUGGING - MAKE SURE TO KILL IT ONCE DONE ****"); log.error(DBTestingHelper.get().getInstance().getCmdLineConnectionString()); log.error("**********************************************************************************************"); return; } if (cacheManager != null) { cacheManager.close(); } if (redissonCachingClient != null) { redissonCachingClient.shutdown(); } try { DBTestingHelper.get().getInstance().stop(); } catch (final Exception ignored) { } }
@BeforeSuite(groups = "slow") public void startMysqlBeforeTestSuite() throws IOException, ClassNotFoundException, SQLException, URISyntaxException { DBTestingHelper.get().start(); }
@BeforeMethod(groups = "slow") public void cleanupTablesBetweenMethods() { try { DBTestingHelper.get().getInstance().cleanupAllTables(); } catch (final Exception ignored) { } }
@BeforeSuite(groups = "slow") public void beforeSuite() throws Exception { // Hack to configure log4jdbc -- properties used by tests will be properly setup in @BeforeClass getConfigSource(ImmutableMap.<String, String>of()); DBTestingHelper.get().start(); }
protected void cleanupAllTables() { try { DBTestingHelper.get().getInstance().cleanupAllTables(); } catch (final Exception e) { Assert.fail("Unable to clean database", e); } }
@AfterSuite(groups = "slow") public void shutdownMysqlAfterTestSuite() throws IOException, ClassNotFoundException, SQLException, URISyntaxException { if (hasFailed()) { log.error("**********************************************************************************************"); log.error("*** TESTS HAVE FAILED - LEAVING DB RUNNING FOR DEBUGGING - MAKE SURE TO KILL IT ONCE DONE ****"); log.error(DBTestingHelper.get().getInstance().getCmdLineConnectionString()); log.error("**********************************************************************************************"); return; } try { DBTestingHelper.get().getInstance().stop(); } catch (final Exception ignored) { } } }
final EmbeddedDB embeddedDB = DBTestingHelper.get().getInstance(); final List<String> tables = embeddedDB.getAllTables();
@AfterSuite(groups = "slow") public void afterSuite() throws Exception { if (hasFailed()) { threadDump(); dumpDB(); log.error("**********************************************************************************************"); log.error("*** TESTS HAVE FAILED - LEAVING DB RUNNING FOR DEBUGGING - MAKE SURE TO KILL IT ONCE DONE ****"); log.error(DBTestingHelper.get().getInstance().getCmdLineConnectionString()); log.error("**********************************************************************************************"); return; } if (cacheManager != null) { cacheManager.close(); } if (redissonCachingClient != null) { redissonCachingClient.shutdown(); } try { DBTestingHelper.get().getInstance().stop(); } catch (final Exception ignored) { } }