Search in sources :

Example 21 with AfterClass

use of org.junit.AfterClass in project Smack by igniterealtime.

the class EntityCapsTest method tearDown.

@AfterClass
public void tearDown() throws NotConnectedException, InterruptedException {
    RosterUtil.ensureNotSubscribedToEachOther(conOne, conTwo);
    ServiceDiscoveryManager[] sdms = new ServiceDiscoveryManager[] { sdmOne, sdmTwo };
    for (ServiceDiscoveryManager sdm : sdms) {
        for (String dummyFeature : dummyFeatures) {
            sdm.removeFeature(dummyFeature);
        }
    }
}
Also used : ServiceDiscoveryManager(org.jivesoftware.smackx.disco.ServiceDiscoveryManager) AfterClass(org.junit.AfterClass)

Example 22 with AfterClass

use of org.junit.AfterClass in project junit4 by junit-team.

the class CategoryValidatorTest method errorIsAddedWhenCategoryIsUsedWithAfterClass.

@Test
public void errorIsAddedWhenCategoryIsUsedWithAfterClass() {
    FrameworkMethod method = new TestClass(CategoryTest.class).getAnnotatedMethods(AfterClass.class).get(0);
    testAndAssertErrorMessage(method, "@AfterClass can not be combined with @Category");
}
Also used : TestClass(org.junit.runners.model.TestClass) FrameworkMethod(org.junit.runners.model.FrameworkMethod) AfterClass(org.junit.AfterClass) Test(org.junit.Test)

Example 23 with AfterClass

use of org.junit.AfterClass in project orientdb by orientechnologies.

the class OrientCommitMT method afterClass.

@AfterClass
public static void afterClass() throws IOException {
    if (DB_URL.startsWith("remote:")) {
        OServerAdmin serverAdmin = new OServerAdmin(DB_URL);
        serverAdmin.connect("root", ODatabaseHelper.getServerRootPassword());
        if (serverAdmin.existsDatabase(OrientGraphTest.getStorageType())) {
            serverAdmin.dropDatabase(OrientGraphTest.getStorageType());
        }
    } else {
        OrientGraph graph = new OrientGraph(DB_URL, DB_USER, DB_PASSWORD);
        graph.drop();
    }
}
Also used : OServerAdmin(com.orientechnologies.orient.client.remote.OServerAdmin) AfterClass(org.junit.AfterClass)

Example 24 with AfterClass

use of org.junit.AfterClass in project orientdb by orientechnologies.

the class OrientGraphNoTxRemoteTest method stopEmbeddedServer.

@AfterClass
public static void stopEmbeddedServer() throws Exception {
    server.shutdown();
    Thread.sleep(1000);
    Orient.instance().closeAllStorages();
    if (oldOrientDBHome != null)
        System.setProperty("ORIENTDB_HOME", oldOrientDBHome);
    else
        System.clearProperty("ORIENTDB_HOME");
    final File file = new File(serverHome);
    deleteDirectory(file);
    OGlobalConfiguration.NETWORK_LOCK_TIMEOUT.setValue(15000);
    Orient.instance().startup();
}
Also used : File(java.io.File) AfterClass(org.junit.AfterClass)

Example 25 with AfterClass

use of org.junit.AfterClass in project querydsl by querydsl.

the class AbstractJDOTest method doCleanUp.

@AfterClass
public static void doCleanUp() {
    // Clean out the database
    PersistenceManager pm = pmf.getPersistenceManager();
    Transaction tx = pm.currentTransaction();
    try {
        tx.begin();
        pm.newQuery(Store.class).deletePersistentAll();
        pm.newQuery(Book.class).deletePersistentAll();
        pm.newQuery(Product.class).deletePersistentAll();
        tx.commit();
    } finally {
        if (tx.isActive()) {
            tx.rollback();
        }
        pm.close();
    }
}
Also used : Transaction(javax.jdo.Transaction) PersistenceManager(javax.jdo.PersistenceManager) Book(com.querydsl.jdo.test.domain.Book) Store(com.querydsl.jdo.test.domain.Store) Product(com.querydsl.jdo.test.domain.Product) AfterClass(org.junit.AfterClass)

Aggregations

AfterClass (org.junit.AfterClass)202 File (java.io.File)76 DalHints (com.ctrip.platform.dal.dao.DalHints)23 Path (org.apache.hadoop.fs.Path)14 FileSystem (org.apache.hadoop.fs.FileSystem)13 HashMap (java.util.HashMap)12 IOException (java.io.IOException)10 ModelNode (org.jboss.dmr.ModelNode)8 StatementParameters (com.ctrip.platform.dal.dao.StatementParameters)7 ScenarioConfiguration (org.apache.hadoop.mapred.nativetask.testutil.ScenarioConfiguration)7 FileOutputStream (java.io.FileOutputStream)6 RelationManager (edu.uci.ics.textdb.storage.RelationManager)5 ClientException (edu.umass.cs.gnscommon.exceptions.client.ClientException)5 Configuration (org.apache.hadoop.conf.Configuration)5 HttpSolrClient (org.apache.solr.client.solrj.impl.HttpSolrClient)5 Method (java.lang.reflect.Method)4 SQLException (java.sql.SQLException)4 Statement (java.sql.Statement)4 LoggerContext (org.apache.logging.log4j.core.LoggerContext)4 GuidEntry (edu.umass.cs.gnsclient.client.util.GuidEntry)3