Search in sources :

Example 26 with AfterAll

use of org.junit.jupiter.api.AfterAll in project rubia-forums by flashboss.

the class ForumInstanceTest method stop.

@AfterAll
public static void stop() {
    log.debug("stopped test");
    Response response = get(url + "removeForumInstance/2", authorization);
    response.readEntity(ForumInstanceBean.class);
    response = get(url + "findForumInstanceById/2", authorization);
    ForumInstanceBean forumInstance = response.readEntity(ForumInstanceBean.class);
    assertNull(forumInstance);
    response.close();
}
Also used : Response(jakarta.ws.rs.core.Response) ForumInstanceBean(it.vige.rubia.dto.ForumInstanceBean) AfterAll(org.junit.jupiter.api.AfterAll)

Example 27 with AfterAll

use of org.junit.jupiter.api.AfterAll in project hibernate-orm by hibernate.

the class SequenceInformationMariaDBTest method releaseResources.

@AfterAll
public void releaseResources() {
    try (Connection connection = connectionProvider.getConnection();
        Statement statement = connection.createStatement()) {
        try {
            statement.execute("DROP SEQUENCE book_sequence");
            statement.execute("DROP SEQUENCE author_sequence");
        } catch (SQLException e) {
        }
        try {
            statement.execute("DROP TABLE TBL_BOOK");
            statement.execute("DROP TABLE TBL_AUTHOR");
        } catch (SQLException e) {
        }
    } catch (SQLException e) {
        fail(e.getMessage());
    }
    if (connectionProvider != null) {
        connectionProvider.stop();
    }
}
Also used : SQLException(java.sql.SQLException) Statement(java.sql.Statement) Connection(java.sql.Connection) AfterAll(org.junit.jupiter.api.AfterAll)

Example 28 with AfterAll

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

the class BatchTriggerTest method terminateVariation.

/**
 * Cleaning up
 *
 * @throws SQLException
 */
@AfterAll
public static void terminateVariation() throws SQLException {
    try (Statement stmt = connection.createStatement()) {
        TestUtils.dropTableIfExists(AbstractSQLGenerator.escapeIdentifier(tableName), stmt);
        stmt.execute("IF EXISTS (\r\n" + "    SELECT *\r\n" + "    FROM sys.objects\r\n" + "    WHERE [type] = 'TR' AND [name] = '" + TestUtils.escapeSingleQuotes(triggerName) + "'\r\n" + "    )\r\n" + "    DROP TRIGGER " + AbstractSQLGenerator.escapeIdentifier(triggerName) + Constants.SEMI_COLON);
    }
}
Also used : PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) AfterAll(org.junit.jupiter.api.AfterAll)

Example 29 with AfterAll

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

the class TVPNumericTest method terminateVariation.

@AfterAll
public static void terminateVariation() throws SQLException {
    try (Statement stmt = connection.createStatement()) {
        TestUtils.dropProcedureIfExists(procedureName, stmt);
        TestUtils.dropTableIfExists(charTableName, stmt);
        TestUtils.dropTypeIfExists(tvpName, stmt);
    }
}
Also used : PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) CallableStatement(java.sql.CallableStatement) SQLServerPreparedStatement(com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement) AfterAll(org.junit.jupiter.api.AfterAll)

Example 30 with AfterAll

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

the class SQLServerSpatialDatatypeTest method afterAll.

/**
 * drop the tables
 *
 * @throws SQLException
 */
@AfterAll
public static void afterAll() throws SQLException {
    try (Statement stmt = connection.createStatement()) {
        TestUtils.dropTableIfExists(AbstractSQLGenerator.escapeIdentifier(geomTableName), stmt);
        TestUtils.dropTableIfExists(AbstractSQLGenerator.escapeIdentifier(geogTableName), stmt);
        TestUtils.dropTableIfExists(AbstractSQLGenerator.escapeIdentifier(spatialDatatypeTableName), stmt);
    }
}
Also used : Statement(java.sql.Statement) SQLServerPreparedStatement(com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement) AfterAll(org.junit.jupiter.api.AfterAll)

Aggregations

AfterAll (org.junit.jupiter.api.AfterAll)225 Statement (java.sql.Statement)39 File (java.io.File)36 PreparedStatement (java.sql.PreparedStatement)18 SQLServerPreparedStatement (com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement)12 Response (jakarta.ws.rs.core.Response)10 CountDownLatch (java.util.concurrent.CountDownLatch)10 CategoryBean (it.vige.rubia.dto.CategoryBean)8 BucketManager (jakarta.nosql.keyvalue.BucketManager)8 BucketManagerFactory (jakarta.nosql.keyvalue.BucketManagerFactory)8 List (java.util.List)8 BucketManager (org.jnosql.diana.api.key.BucketManager)8 BucketManagerFactory (org.jnosql.diana.api.key.BucketManagerFactory)8 ForumBean (it.vige.rubia.dto.ForumBean)7 PosterBean (it.vige.rubia.dto.PosterBean)7 GenericType (jakarta.ws.rs.core.GenericType)7 Connection (java.sql.Connection)7 Arrays.asList (java.util.Arrays.asList)7 BeforeAll (org.junit.jupiter.api.BeforeAll)7 TopicBean (it.vige.rubia.dto.TopicBean)6