本文整理汇总了Java中org.junit.AfterClass类的典型用法代码示例。如果您正苦于以下问题:Java AfterClass类的具体用法?Java AfterClass怎么用?Java AfterClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AfterClass类属于org.junit包,在下文中一共展示了AfterClass类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shutdownTestEnvironment
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void shutdownTestEnvironment(){
//shutdown jmx and service
ComponentHelper.shutdownService(service);
//clean up folder
FileManager.removeAllFilesInDirectory(testSpaceDirectory);
if(FileManager.countFilesInDirectory(testSpaceDirectoryDirect) > 0){
//FileManager.removeAllFilesInDirectory(testSpaceDirectoryDirect);
}else{
log.log(Level.INFO, "there wasnt any file in the directory, either the writer deleted it already (good) or was there any exception? (bad)");
}
if(FileManager.countFilesInDirectory(testSpaceDirectoryNetwork) > 0){
//FileManager.removeAllFilesInDirectory(testSpaceDirectoryNetwork);
}else{
log.log(Level.INFO, "there wasnt any file in the directory, either the writer deleted it already (good) or was there any exception? (bad)");
}
}
示例2: cleanupStatic
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void cleanupStatic() {
if (oldAuthProvider != null) {
System.setProperty("zookeeper.authProvider.1", oldAuthProvider);
} else {
System.clearProperty("zookeeper.authProvider.1");
}
oldAuthProvider = null;
if (oldLoginConfig != null) {
System.setProperty("java.security.auth.login.config", oldLoginConfig);
} else {
System.clearProperty("java.security.auth.login.config");
}
oldLoginConfig = null;
if (oldSuperUser != null) {
System.setProperty("zookeeper.superUser", oldSuperUser);
} else {
System.clearProperty("zookeeper.superUser");
}
oldSuperUser = null;
}
示例3: tearDownClass
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void tearDownClass() {
ServicesHolder.unsetRunnableDeviceService(dService);
dService = null;
connector = null;
}
示例4: afterClass
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void afterClass() {
try {
if (testEnvironment != null) {
testEnvironment.destroy();
}
} catch (Exception e) {
// nothing we can do
e.printStackTrace();
}
}
示例5: tearDown
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void tearDown() {
dataService = null;
billingService = null;
configurationService = null;
identityServiceLocal = null;
basicSetup = null;
customersPerScenario = null;
subscriptionCache = null;
testCache = null;
}
示例6: stopServer
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void stopServer() throws InterruptedException {
server.shutdown();
server.awaitTermination();
channel.shutdown();
server = null;
channel = null;
}
示例7: stopHttpd
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void stopHttpd() throws IOException {
for (int i = 0; i < internalCluster().size(); i++) {
// shut them all down otherwise we get spammed with connection refused exceptions
internalCluster().stopRandomDataNode();
}
httpServer.stop(0);
httpServer = null;
logDir = null;
}
示例8: clean
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void clean() {
File file = new File(TEST_FILE);
if (file.exists()) {
file.delete();
}
}
示例9: cleanup
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void cleanup() throws Exception {
server.stop();
FileUtil.fullyDelete(new File(BASEDIR));
KeyStoreTestUtil.cleanupSSLConfig(keystoresDir, sslConfDir);
clientSslFactory.destroy();
}
示例10: afterClass
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void afterClass() throws Exception {
if (elastic != null) {
try {
elastic.wipe();
elastic.close();
elastic = null;
} catch (Throwable t) {
logger.error("Error shutting down elasticsearch cluster", t);
elastic = null;
}
}
}
示例11: tearDown
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void tearDown() {
try {
if (zkClient != null) {
zkClient.close();
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
示例12: tearDownAfterClass
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void tearDownAfterClass() {
if (em != null) {
em.close();
}
JpaEntityManager.getInstance().close();
}
示例13: bye
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void bye() throws Exception {
// Disable error injection or else the deletion would fail!
AmazonHttpClient.configUnreliableTestConditions(null);
client.deleteTable(DeleteTableRequest.builder().tableName(TABLE_NAME).build());
client.close();
}
示例14: tearDownLdapCodecService
import org.junit.AfterClass; //导入依赖的package包/类
/**
* Shutdown the codec service
*/
@AfterClass
public static void tearDownLdapCodecService()
{
codec = null;
encoder = null;
}
示例15: tearDown
import org.junit.AfterClass; //导入依赖的package包/类
@AfterClass
public static void tearDown() {
if(server != null) {
try {
Thread.sleep(100);
} catch (InterruptedException ignored) {
}
server.stop();
logger.info("The server is stopped.");
}
}