Search in sources :

Example 41 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 42 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 43 with AfterClass

use of org.junit.AfterClass in project SmartCity-Market by TechnionYP5777.

the class UpdateProductPicturesEmployeeTest method cleanup.

@AfterClass
public static void cleanup() {
    if (doCleanUp)
        try {
            File fileToDelete = new File(createdFilePath);
            fileToDelete.delete();
        } catch (Exception e) {
            System.out.println(e + "");
            fail();
        }
}
Also used : File(java.io.File) IOException(java.io.IOException) AfterClass(org.junit.AfterClass)

Example 44 with AfterClass

use of org.junit.AfterClass in project tdi-studio-se by Talend.

the class AddContextCommentValueMigrationTaskTest method afterAllTests.

@AfterClass
public static void afterAllTests() throws PersistenceException, CoreException {
    removeTempProject();
    Context ctx = CoreRuntimePlugin.getInstance().getContext();
    RepositoryContext repositoryContext = (RepositoryContext) ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
    repositoryContext.setProject(originalProject);
    originalProject = null;
    sampleProject = null;
}
Also used : Context(org.talend.core.context.Context) RepositoryContext(org.talend.core.context.RepositoryContext) RepositoryContext(org.talend.core.context.RepositoryContext) AfterClass(org.junit.AfterClass)

Example 45 with AfterClass

use of org.junit.AfterClass in project tdi-studio-se by Talend.

the class FixUnevenItemContextParametersMigrationTaskTest method afterAllTests.

@AfterClass
public static void afterAllTests() throws PersistenceException, CoreException {
    removeTempProject();
    Context ctx = CoreRuntimePlugin.getInstance().getContext();
    RepositoryContext repositoryContext = (RepositoryContext) ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
    repositoryContext.setProject(originalProject);
    originalProject = null;
    sampleProject = null;
}
Also used : Context(org.talend.core.context.Context) RepositoryContext(org.talend.core.context.RepositoryContext) RepositoryContext(org.talend.core.context.RepositoryContext) AfterClass(org.junit.AfterClass)

Aggregations

AfterClass (org.junit.AfterClass)231 File (java.io.File)83 DalHints (com.ctrip.platform.dal.dao.DalHints)25 FileSystem (org.apache.hadoop.fs.FileSystem)14 Path (org.apache.hadoop.fs.Path)14 HashMap (java.util.HashMap)12 IOException (java.io.IOException)11 StatementParameters (com.ctrip.platform.dal.dao.StatementParameters)9 ModelNode (org.jboss.dmr.ModelNode)8 Statement (java.sql.Statement)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 RelationManager (edu.uci.ics.texera.storage.RelationManager)4 Method (java.lang.reflect.Method)4 SQLException (java.sql.SQLException)4 LoggerContext (org.apache.logging.log4j.core.LoggerContext)4