use of org.junit.AfterClass in project randomizedtesting by randomizedtesting.
the class WithNestedTestClass method clearNested.
@AfterClass
public static final void clearNested() throws Exception {
zombieToken = null;
runningNested = false;
ApplyAtPlace.runnable = null;
ApplyAtPlace.place = null;
System.setOut(sysout);
System.setErr(syserr);
for (Handler h : logger.getHandlers()) logger.removeHandler(h);
for (Handler h : handlers) logger.addHandler(h);
for (Thread t : zombies) {
t.interrupt();
}
for (Thread t : zombies) {
t.join();
}
}
use of org.junit.AfterClass in project DirectMemory by raffaeleguidi.
the class BaseTests method setup.
@BeforeClass
@AfterClass
public static void setup() {
rnd = new Random();
// logger.info("off-heap allocated: " + Ram.inMb(mem.capacity()));
// logger.info("off-heap used: " + Ram.inMb(mem.used()));
logger.info("test - size: " + test.size());
logger.info("test - errors: " + errors);
logger.info("heap - max: " + Ram.inMb(Runtime.getRuntime().maxMemory()));
logger.info("heap - allocated: " + Ram.inMb(Runtime.getRuntime().totalMemory()));
logger.info("heap - free : " + Ram.inMb(Runtime.getRuntime().freeMemory()));
logger.info("************************************************");
}
use of org.junit.AfterClass in project camel by apache.
the class BaseNettyTest method savePort.
@AfterClass
public static void savePort() throws Exception {
File file = new File("target/nettyport.txt");
// save to file, do not append
FileOutputStream fos = new FileOutputStream(file, false);
try {
fos.write(String.valueOf(port).getBytes());
} finally {
fos.close();
}
}
use of org.junit.AfterClass in project camel by apache.
the class BaseNettyTest method verifyNoLeaks.
@AfterClass
public static void verifyNoLeaks() throws Exception {
//Force GC to bring up leaks
System.gc();
//Kick leak detection logging
ByteBufAllocator.DEFAULT.buffer(1).release();
Collection<LogEvent> events = LogCaptureAppender.getEvents();
if (!events.isEmpty()) {
String message = "Leaks detected while running tests: " + events;
// Just write the message into log to help debug
for (LogEvent event : events) {
LOG.info(event.getMessage().getFormattedMessage());
}
LogCaptureAppender.reset();
throw new AssertionError(message);
}
}
use of org.junit.AfterClass in project graphhopper by graphhopper.
the class ChangeGraphServletIT method cleanUp.
@AfterClass
public static void cleanUp() {
Helper.removeDir(new File(DIR));
shutdownJetty(true);
}
Aggregations