Search in sources :

Example 1 with AfterAll

use of org.junit.jupiter.api.AfterAll in project mssql-jdbc by Microsoft.

the class bvtTest method terminate.

/**
 * drops tables
 *
 * @throws SQLException
 */
@AfterAll
public static void terminate() throws SQLException {
    try (DBConnection conn = new DBConnection(connectionString);
        DBStatement stmt = conn.createStatement()) {
        stmt.execute("if object_id('" + table1.getEscapedTableName() + "','U') is not null" + " drop table " + table1.getEscapedTableName());
        stmt.execute("if object_id('" + table2.getEscapedTableName() + "','U') is not null" + " drop table " + table2.getEscapedTableName());
    }
}
Also used : DBConnection(com.microsoft.sqlserver.testframework.DBConnection) DBStatement(com.microsoft.sqlserver.testframework.DBStatement) AfterAll(org.junit.jupiter.api.AfterAll)

Example 2 with AfterAll

use of org.junit.jupiter.api.AfterAll in project mssql-jdbc by Microsoft.

the class BatchExecutionWithNullTest method terminateVariation.

@AfterAll
public static void terminateVariation() throws SQLException {
    connection = DriverManager.getConnection(connectionString);
    SQLServerStatement stmt = (SQLServerStatement) connection.createStatement();
    Utils.dropTableIfExists("esimple", stmt);
    if (null != pstmt) {
        pstmt.close();
    }
    if (null != pstmt1) {
        pstmt1.close();
    }
    if (null != stmt) {
        stmt.close();
    }
    if (null != rs) {
        rs.close();
    }
    if (null != connection) {
        connection.close();
    }
}
Also used : SQLServerStatement(com.microsoft.sqlserver.jdbc.SQLServerStatement) AfterAll(org.junit.jupiter.api.AfterAll)

Example 3 with AfterAll

use of org.junit.jupiter.api.AfterAll in project mssql-jdbc by Microsoft.

the class RegressionTest method cleanup.

/**
 * Cleanup after test
 *
 * @throws SQLException
 */
@AfterAll
public static void cleanup() throws SQLException {
    Statement stmt = con.createStatement();
    Utils.dropTableIfExists("x", stmt);
    Utils.dropTableIfExists("TEST_TABLE", stmt);
    if (null != stmt) {
        stmt.close();
    }
    if (null != con) {
        con.close();
    }
    if (null != pstmt1) {
        pstmt1.close();
    }
    if (null != pstmt2) {
        pstmt2.close();
    }
}
Also used : PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) AfterAll(org.junit.jupiter.api.AfterAll)

Example 4 with AfterAll

use of org.junit.jupiter.api.AfterAll in project tutorials-java by Artister.

the class PowerPointIntegrationTest method tearDown.

@AfterAll
public void tearDown() throws Exception {
    File testFile = new File(fileLocation);
    if (testFile.exists()) {
        testFile.delete();
    }
    pph = null;
}
Also used : File(java.io.File) AfterAll(org.junit.jupiter.api.AfterAll)

Example 5 with AfterAll

use of org.junit.jupiter.api.AfterAll in project jnosql-diana-driver by eclipse.

the class DocumentQueryTest method afterClass.

@AfterAll
public static void afterClass() {
    CouchbaseKeyValueConfiguration configuration = new CouchbaseKeyValueConfiguration();
    BucketManagerFactory keyValueEntityManagerFactory = configuration.get();
    BucketManager keyValueEntityManager = keyValueEntityManagerFactory.getBucketManager(CouchbaseUtil.BUCKET_NAME);
    keyValueEntityManager.remove("person:id");
    keyValueEntityManager.remove("person:id2");
    keyValueEntityManager.remove("person:id3");
    keyValueEntityManager.remove("person:id4");
}
Also used : CouchbaseKeyValueConfiguration(org.jnosql.diana.couchbase.key.CouchbaseKeyValueConfiguration) BucketManager(org.jnosql.diana.api.key.BucketManager) BucketManagerFactory(org.jnosql.diana.api.key.BucketManagerFactory) AfterAll(org.junit.jupiter.api.AfterAll)

Aggregations

AfterAll (org.junit.jupiter.api.AfterAll)30 File (java.io.File)13 BucketManager (org.jnosql.diana.api.key.BucketManager)8 BucketManagerFactory (org.jnosql.diana.api.key.BucketManagerFactory)8 lombok.val (lombok.val)4 PreparedStatement (java.sql.PreparedStatement)3 Statement (java.sql.Statement)3 CouchbaseKeyValueConfiguration (org.jnosql.diana.couchbase.key.CouchbaseKeyValueConfiguration)3 IOException (java.io.IOException)2 FileSystemException (java.nio.file.FileSystemException)2 LoggerContext (org.apache.logging.log4j.core.LoggerContext)2 SQLServerConnection (com.microsoft.sqlserver.jdbc.SQLServerConnection)1 SQLServerPreparedStatement (com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement)1 SQLServerStatement (com.microsoft.sqlserver.jdbc.SQLServerStatement)1 DBConnection (com.microsoft.sqlserver.testframework.DBConnection)1 DBStatement (com.microsoft.sqlserver.testframework.DBStatement)1 Field (java.lang.reflect.Field)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 CallableStatement (java.sql.CallableStatement)1 FileUtils (org.apache.commons.io.FileUtils)1