@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) { } } }
@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) { } }
@Override public void stop() throws IOException { started.set(false); super.stop(); } }
@AfterClass(groups = "slow") public void tearDownAfterClass() throws Exception { embeddedDB.stop(); } }
@AfterClass(groups = "slow") public void afterClass() throws Exception { embeddedDB.stop(); }
@AfterMethod(groups = "slow") public void tearDown() throws Exception { embeddedDB.stop(); }
@Override public void stop() throws IOException { if (!started.get()) { throw new IOException("H2 is not running"); } super.stop(); if (dataSource instanceof JdbcConnectionPool) { ((JdbcConnectionPool) dataSource).dispose(); } if (server != null) { server.stop(); // Shutdown the MVStore final Properties info = new Properties(); info.setProperty("user", username); info.put("password", password); final ConnectionInfo ci = new ConnectionInfo(jdbcConnectionString, info); final Session session = Engine.getInstance().createSession(ci); if (session.getDatabase() != null && session.getDatabase().getMvStore() != null) { session.getDatabase().getMvStore().close(0); } } started.set(false); logger.info(String.format("H2 stopped on http://127.0.0.1:8082. JDBC=%s, Username=%s, Password=%s", getJdbcConnectionString(), getUsername(), getPassword())); }
@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) { } } }
@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) { } }