Search in sources :

Example 6 with AfterSuite

use of org.testng.annotations.AfterSuite in project pinot by linkedin.

the class TestStarTreeOffheapFormat method tearDown.

/**
   * Cleanup any temporary files and directories.
   * @throws IOException
   */
@AfterSuite
void tearDown() throws IOException {
    FileUtils.deleteDirectory(new File(SEGMENT_DIR_NAME));
    FileUtils.deleteDirectory(new File(SEGMENT_OFF_HEAP_DIR_NAME));
}
Also used : File(java.io.File) AfterSuite(org.testng.annotations.AfterSuite)

Example 7 with AfterSuite

use of org.testng.annotations.AfterSuite in project OpenAM by OpenRock.

the class DataStoreTest method deleteDataStores.

/*
 * The following test will fail under flat file configuration datastore
 * because there is not notification in place. Service Configurations is not
 * made avaiable after they are created.
 * Works OK with Sun DS as configuration datastore.

    @Parameters ({"realm"})
    @Test(groups = {"cli-datastore", "ops", "update-datastore"},
        dependsOnMethods = {"createDataStore"}
    )
    public void updateDataStore(String realm)
        throws CLIException {
        String[] param = {realm};
        entering("updateDataStore", param);
        String[] args = {
            "update-datastore",
            CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME,
            realm,
            CLIConstants.PREFIX_ARGUMENT_LONG + DatastoreOptions.DATASTORE_NAME,
            TEST_DATASTORE_NAME,
            CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.ATTRIBUTE_VALUES,
            "sunFilesIdRepoDirectory=/tmp/clitestdatastoreChanged"
        };

        CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
        cmdManager.addToRequestQueue(req);
        cmdManager.serviceRequestQueue();
        exiting("updateDataStore");
    } */
@Parameters({ "realm" })
@AfterSuite(groups = { "cli-datastore", "delete-datastores" })
public void deleteDataStores(String realm) throws CLIException {
    String[] param = { realm };
    entering("deleteDataStores", param);
    String[] args = { "delete-datastores", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm, CLIConstants.PREFIX_ARGUMENT_LONG + DatastoreOptions.DATASTORE_NAMES, TEST_DATASTORE_NAME };
    CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
    cmdManager.addToRequestQueue(req);
    cmdManager.serviceRequestQueue();
    exiting("deleteDataStores");
}
Also used : CLIRequest(com.sun.identity.cli.CLIRequest) Parameters(org.testng.annotations.Parameters) AfterSuite(org.testng.annotations.AfterSuite)

Example 8 with AfterSuite

use of org.testng.annotations.AfterSuite in project rhsm-qe by RedHatQE.

the class SubscriptionManagerCLITestScript method unregisterClientsAfterSuite.

@AfterSuite(groups = { "cleanup" }, description = "subscription manager tear down")
public void unregisterClientsAfterSuite() {
    for (SubscriptionManagerTasks clienttasks : Arrays.asList(client1tasks, client2tasks)) {
        if (clienttasks != null) {
            // release the entitlements consumed by the current registration
            clienttasks.unregister_(null, null, null, null);
            // in case the unregister fails, also clean the client
            clienttasks.clean_();
        }
    }
}
Also used : SubscriptionManagerTasks(rhsm.cli.tasks.SubscriptionManagerTasks) AfterSuite(org.testng.annotations.AfterSuite)

Example 9 with AfterSuite

use of org.testng.annotations.AfterSuite in project rhsm-qe by RedHatQE.

the class SubscriptionManagerCLITestScript method deleteAllRegisteredConsumerEntitlementsAfterSuite.

@AfterSuite(groups = { "cleanup" }, description = "attempt to delete any abandoned entitlements granted during the run of this suite")
public void deleteAllRegisteredConsumerEntitlementsAfterSuite() {
    // /*debugTestSSL*/ if(true) return;
    for (SubscriptionManagerTasks clienttasks : Arrays.asList(client1tasks, client2tasks)) {
        if (clienttasks != null) {
            // determine the url to the server
            String url = "https://" + clienttasks.getConfFileParameter(clienttasks.rhsmConfFile, "server", "hostname") + ":" + clienttasks.getConfFileParameter(clienttasks.rhsmConfFile, "server", "port") + clienttasks.getConfFileParameter(clienttasks.rhsmConfFile, "server", "prefix");
            // for (String consumerCertPath : Arrays.asList(clienttasks.sshCommandRunner.runCommandAndWait("find "+allRegisteredConsumerCertsDir+" -name '*cert.pem'").getStdout().trim().split("\n"))) {
            for (String consumerCertPath : Arrays.asList(clienttasks.sshCommandRunner.runCommandAndWait("ls -t1 " + allRegisteredConsumerCertsDir + "/*cert.pem").getStdout().trim().split("\n"))) {
                // process consumers in reverse order of their creation
                if (consumerCertPath.isEmpty())
                    continue;
                // extract the uuid from the consumerCertPath
                String uuid = consumerCertPath.replace(allRegisteredConsumerCertsDir, "").replace("_cert.pem", "").replace("/", "");
                // extract the key from the consumerCertPath
                String consumerKeyPath = consumerCertPath.replace("cert.pem", "key.pem");
                // curl -k --cert /etc/pki/consumer/cert.pem --key /etc/pki/consumer/key.pem -X DELETE https://subscription.rhn.stage.redhat.com/subscription/consumers/2f801f45-3b79-42ee-9013-f4ad5bd35c3a/entitlements
                clienttasks.sshCommandRunner.runCommandAndWait("curl --stderr /dev/null --insecure --cert " + consumerCertPath + " --key " + consumerKeyPath + " --request DELETE " + url + "/consumers/" + uuid + "/entitlements");
            }
        }
    }
}
Also used : SubscriptionManagerTasks(rhsm.cli.tasks.SubscriptionManagerTasks) AfterSuite(org.testng.annotations.AfterSuite)

Example 10 with AfterSuite

use of org.testng.annotations.AfterSuite in project ballerina by ballerina-lang.

the class SQLXATransactionsTest method cleanup.

@AfterSuite
public void cleanup() {
    SQLDBUtils.deleteDirectory(new File(SQLDBUtils.DB_DIRECTORY_H2_1));
    SQLDBUtils.deleteDirectory(new File(SQLDBUtils.DB_DIRECTORY_H2_2));
}
Also used : File(java.io.File) AfterSuite(org.testng.annotations.AfterSuite)

Aggregations

AfterSuite (org.testng.annotations.AfterSuite)15 Parameters (org.testng.annotations.Parameters)7 File (java.io.File)4 CloudbreakClient (com.sequenceiq.cloudbreak.client.CloudbreakClient)2 Path (java.nio.file.Path)2 SubscriptionManagerTasks (rhsm.cli.tasks.SubscriptionManagerTasks)2 AmazonCloudFormationClient (com.amazonaws.services.cloudformation.AmazonCloudFormationClient)1 DeleteStackRequest (com.amazonaws.services.cloudformation.model.DeleteStackRequest)1 GoogleCredential (com.google.api.client.googleapis.auth.oauth2.GoogleCredential)1 GoogleNetHttpTransport (com.google.api.client.googleapis.javanet.GoogleNetHttpTransport)1 HttpTransport (com.google.api.client.http.HttpTransport)1 JacksonFactory (com.google.api.client.json.jackson2.JacksonFactory)1 Compute (com.google.api.services.compute.Compute)1 Builder (com.google.api.services.compute.Compute.Builder)1 Delete (com.google.api.services.compute.Compute.Networks.Delete)1 Operation (com.google.api.services.compute.model.Operation)1 ApplicationTokenCredentials (com.microsoft.azure.credentials.ApplicationTokenCredentials)1 Azure (com.microsoft.azure.management.Azure)1 CLIRequest (com.sun.identity.cli.CLIRequest)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1