Java 类org.junit.AfterClass 实例源码

项目:Byter    文件:CommanderWorkflowTest.java   
@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)");
    }

}
项目:https-github.com-apache-zookeeper    文件:SaslSuperUserTest.java   
@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;
   }
项目:scanning    文件:PositionerAtomProcessTest.java   
@AfterClass
public static void tearDownClass() {
    ServicesHolder.unsetRunnableDeviceService(dService);
    dService = null;

    connector = null;
}
项目:rjb-blog-multitenancy    文件:AbstractTest.java   
@AfterClass
public static void afterClass() {
    try {
        if (testEnvironment != null) {
            testEnvironment.destroy();
        }
    } catch (Exception e) {
        // nothing we can do
        e.printStackTrace();
    }
}
项目:oscm    文件:BillingIntegrationTestBase.java   
@AfterClass
public static void tearDown() {
    dataService = null;
    billingService = null;
    configurationService = null;
    identityServiceLocal = null;
    basicSetup = null;
    customersPerScenario = null;
    subscriptionCache = null;
    testCache = null;
}
项目:reactive-grpc    文件:ReactiveClientStandardServerInteropTest.java   
@AfterClass
public static void stopServer() throws InterruptedException {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
项目:elasticsearch_my    文件:Ec2DiscoveryClusterFormationTests.java   
@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;
}
项目:oscm    文件:WsdlHandleTaskTest.java   
@AfterClass
public static void clean() {
    File file = new File(TEST_FILE);
    if (file.exists()) {
        file.delete();
    }
}
项目:hadoop    文件:TestHttpCookieFlag.java   
@AfterClass
public static void cleanup() throws Exception {
  server.stop();
  FileUtil.fullyDelete(new File(BASEDIR));
  KeyStoreTestUtil.cleanupSSLConfig(keystoresDir, sslConfDir);
  clientSslFactory.destroy();
}
项目:dremio-oss    文件:ElasticBaseTestQuery.java   
@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;
    }
  }
}
项目:cakes    文件:SimpleCRUD.java   
@AfterClass
public static void tearDown() {
    try {
        if (zkClient != null) {
            zkClient.close();
        }
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
项目:phoenix-hibernate-dialect    文件:PhoenixDialectTest.java   
@AfterClass
public static void tearDownAfterClass() {
    if (em != null) {
        em.close();
    }
    JpaEntityManager.getInstance().close();
}
项目:aws-sdk-java-v2    文件:TT0035900619IntegrationTest.java   
@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();
}
项目:directory-ldap-api    文件:AbstractCodecServiceTest.java   
/**
 * Shutdown the codec service
 */
@AfterClass
public static void tearDownLdapCodecService()
{
    codec = null;
    encoder = null;
}
项目:light-graphql-4j    文件:ValidatorHandlerTest.java   
@AfterClass
public static void tearDown() {
    if(server != null) {
        try {
            Thread.sleep(100);
        } catch (InterruptedException ignored) {

        }
        server.stop();
        logger.info("The server is stopped.");
    }
}
项目:calcite-avatica    文件:AvaticaResultSetConversionsTest.java   
@AfterClass
public static void cleanupQuery() throws SQLException {
  if (resultSet != null) {
    resultSet.close();
  }

  if (connection != null) {
    connection.close();
  }
}
项目:alfresco-repository    文件:QNameTypeEditorTest.java   
/**
 * Clear up after all the tests have finished and dereference the application context to allow it to be garbage
 * collected.
 */
@AfterClass
public static void tidyAfterTestClass()
{
    ApplicationContextHelper.closeApplicationContext();
    applicationContext = null;
}
项目:hadoop    文件:TestMROldApiJobs.java   
@AfterClass
public static void tearDown() {
  if (mrCluster != null) {
    mrCluster.stop();
    mrCluster = null;
  }
}
项目:flow-platform    文件:TestBase.java   
@AfterClass
public static void afterClass() throws IOException {
    // clean up cmd log folder
    Stream<Path> list = Files.list(CMD_LOG_DIR);
    list.forEach(path -> {
        try {
            Files.deleteIfExists(path);
        } catch (IOException e) {
            e.printStackTrace();
        }
    });
}
项目:ciguan    文件:ConfigurationTest.java   
@AfterClass
public static void after() {
    StringBuilder tBuffer = new StringBuilder();
    if (!cLoadedOk) {
        return;
    }
    System.out.println("");
    cLoadedOk = false;
    try {
        if (cErrors.isEmpty()) {
            System.out.println("Found no errors\n");
        }
        else {
            tBuffer.append(("Found " + cErrors.size() + " errors:\n"));
            Collections.sort(cErrors);
            for (String tError : cErrors) {
                tBuffer.append("  ").append(tError).append("\n");
            }
            System.out.println(tBuffer.toString());
        }
        tBuffer.setLength(0);
        if (cWarnings.isEmpty()) {
            System.out.println("Found no warnings\n");
        }
        else {
            tBuffer.append(("Found " + cWarnings.size() + " warnings:\n"));
            Collections.sort(cWarnings);
            for (String tWarning : cWarnings) {
                tBuffer.append("  ").append(tWarning).append("\n");
            }
            System.out.println(tBuffer.toString());
        }
    }
    catch (Exception e) {
        //TODO: handle io problems
    }
    if (!cErrors.isEmpty()) {
        Assert.fail();
    }
}
项目:SWET    文件:WriteScriptFileTest.java   
@AfterClass
public static void Cleanup() {
    /*
    try {
        FileUtils.deleteDirectory(new File(scriptsPath));
    } catch (IOException e) {
    }
    */
}
项目:Byter    文件:JmxClientNetworkTest.java   
@AfterClass
public static void endTest(){
    service.shutdown();
    ThreadManager.nap(1000); //wait for the service to shutdown properly
    if(!service.isShutdown()){
        service.shutdownNow(); //still running? killing it not softly it is!
    }
    ThreadManager.nap(1000);
}
项目:marklogic-rdf4j    文件:MarkLogicRepositoryTest.java   
@AfterClass
public static void tearDownSetup() throws Exception  {
       associateRESTServerWithDB(restServer,"Documents");
       for (int i =0 ; i < hostNames.length; i++){
           detachForest(dbName, dbName+"-"+(i+1));
           deleteForest(dbName+"-"+(i+1));
       }

       deleteDB(dbName);

}
项目:hashsdn-controller    文件:AbstractRpcTest.java   
@AfterClass
public static void teardown() {
    JavaTestKit.shutdownActorSystem(node1);
    JavaTestKit.shutdownActorSystem(node2);
    node1 = null;
    node2 = null;
}
项目:personium-core    文件:BarInstallTest.java   
/**
 * すべてのテスト完了時に実行される処理.
 */
@AfterClass
public static void afterClass() {
}
项目:ditb    文件:TestDrainingServer.java   
@AfterClass
public static void afterClass() throws Exception {
  TEST_UTIL.shutdownMiniZKCluster();
}
项目:talchain    文件:MineBlock.java   
@AfterClass
public static void cleanup() {
    SystemProperties.resetToDefault();
}
项目:sjk    文件:CatalogMapperTest.java   
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
项目:holon-json    文件:TestResteasyIntegrationContext.java   
@AfterClass
public static void shutdown() {
    server.stop();
}
项目:tomcat_exporter    文件:TomcatJDbcp2PoolExportsTest.java   
@AfterClass
public static void tearDown() throws Exception {
    shutDownTomcat();
}
项目:cas-5.1.0    文件:LdapAuthenticationHandlerTests.java   
@AfterClass
public static void shutdown() throws Exception {
    DIRECTORY.close();
}
项目:monarch    文件:RuleListTest.java   
@AfterClass
public static void tearDownClass() {
  counter = null;
  invocations = null;
  ThreeRules.ruleListStatic = null;
}
项目:QDrill    文件:JdbcNullOrderingAndGroupingTest.java   
@AfterClass
public static void resetDefaults() throws Exception {
  testQuery(String.format("alter session set `%s` = false", PlannerSettings.ENABLE_DECIMAL_DATA_TYPE_KEY));
}
项目:hadoop-oss    文件:TestHttpServerLogs.java   
@AfterClass
public static void cleanup() throws Exception {
  if (server != null && server.isAlive()) {
    server.stop();
  }
}
项目:smile_1.5.0_java7    文件:NeuralMapTest.java   
@AfterClass
public static void tearDownClass() throws Exception {
}
项目:ditb    文件:TestInfoServers.java   
@AfterClass
public static void afterClass() throws Exception {
  UTIL.shutdownMiniCluster();
}
项目:ditb    文件:TestRestoreFlushSnapshotFromClient.java   
@AfterClass
public static void tearDownAfterClass() throws Exception {
  UTIL.shutdownMiniCluster();
}
项目:sstore-soft    文件:TestJDBCDriver.java   
@AfterClass
public static void tearDown() throws Exception {
    stopServer();
    File f = new File(testjar);
    f.delete();
}
项目:smile_1.5.0_java7    文件:MDSTest.java   
@AfterClass
public static void tearDownClass() throws Exception {
}
项目:ditb    文件:TestHalfStoreFileReader.java   
@AfterClass
public static void tearDownAfterClass() throws Exception {
  TEST_UTIL.cleanupTestDir();
}