use of org.openjdk.jmh.annotations.TearDown in project logging-log4j2 by apache.
the class JpaAppenderBenchmark method tearDown.
@TearDown
public void tearDown() throws SQLException {
final LoggerContext context = LoggerContext.getContext(false);
try {
((JpaAppender) context.getConfiguration().getAppender("H2Appender")).getManager().close();
((JpaAppender) context.getConfiguration().getAppender("HSQLDBAppender")).getManager().close();
} finally {
System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
// context.reconfigure();
// StatusLogger.getLogger().reset();
Statement statement = null;
try {
statement = connectionHSQLDB.createStatement();
statement.execute("SHUTDOWN");
} catch (final SQLException ignore) {
// ignore
} finally {
Closer.closeSilently(statement);
Closer.closeSilently(connectionHSQLDB);
}
try {
statement = connectionH2.createStatement();
statement.execute("SHUTDOWN");
} catch (final SQLException ignore) {
// ignore
} finally {
Closer.closeSilently(statement);
Closer.closeSilently(connectionH2);
}
}
}
use of org.openjdk.jmh.annotations.TearDown in project logging-log4j2 by apache.
the class AsyncLoggersLocationBenchmark method down.
@TearDown(Level.Trial)
public void down() {
((LifeCycle) LogManager.getContext(false)).stop();
new File("perftest.log").delete();
}
use of org.openjdk.jmh.annotations.TearDown in project logging-log4j2 by apache.
the class JdbcAppenderBenchmark method tearDown.
@TearDown
public void tearDown() throws SQLException {
final LoggerContext context = LoggerContext.getContext(false);
try {
((JdbcAppender) context.getConfiguration().getAppender("H2Appender")).getManager().close();
((JdbcAppender) context.getConfiguration().getAppender("HSQLDBAppender")).getManager().close();
} finally {
System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
// context.reconfigure();
// StatusLogger.getLogger().reset();
Statement statement = null;
try {
statement = connectionHSQLDB.createStatement();
statement.execute("SHUTDOWN");
} catch (final SQLException ignore) {
// ignore
} finally {
Closer.closeSilently(statement);
Closer.closeSilently(connectionHSQLDB);
}
try {
statement = connectionH2.createStatement();
statement.execute("SHUTDOWN");
} catch (final SQLException ignore) {
// ignore
} finally {
Closer.closeSilently(statement);
Closer.closeSilently(connectionH2);
}
}
}
use of org.openjdk.jmh.annotations.TearDown in project logging-log4j2 by apache.
the class AsyncAppenderLog4j2Benchmark method down.
@TearDown(Level.Trial)
public void down() {
((LifeCycle) LogManager.getContext(false)).stop();
new File("perftest.log").delete();
}
use of org.openjdk.jmh.annotations.TearDown in project logging-log4j2 by apache.
the class AsyncAppenderLogbackBenchmark method down.
@TearDown(Level.Trial)
public void down() {
((LifeCycle) LoggerFactory.getILoggerFactory()).stop();
new File("perftest.log").delete();
}
Aggregations