Search in sources :

Example 51 with AfterClass

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

the class RestTest method cleanup.

@AfterClass
public void cleanup() throws Exception {
    PrivilegeManager pm = PrivilegeManager.getInstance(REALM, adminSubject);
    pm.remove(PRIVILEGE_NAME);
    IdRepoUtils.deleteIdentity(REALM, user);
}
Also used : PrivilegeManager(com.sun.identity.entitlement.PrivilegeManager) AfterClass(org.testng.annotations.AfterClass)

Example 52 with AfterClass

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

the class IOTest method cleanup.

@AfterClass
public void cleanup() {
    File f = new File(FILENAME);
    f.delete();
    f = new File(JSON_FILENAME);
    f.delete();
}
Also used : File(java.io.File) AfterClass(org.testng.annotations.AfterClass)

Example 53 with AfterClass

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

the class ComplianceTests method configureProductCertDirAfterClass.

@AfterClass(groups = { "setup" }, alwaysRun = true)
public void configureProductCertDirAfterClass() {
    if (clienttasks == null)
        return;
    if (this.originalProductCertDir != null) {
        clienttasks.updateConfFileParameter(clienttasks.rhsmConfFile, "productCertDir", this.originalProductCertDir);
        // TEMPORARY WORKAROUND
        boolean invokeWorkaroundWhileBugIsOpen = true;
        // Bug 1351370 - [ERROR] subscription-manager:31276 @dbus_interface.py:60 - org.freedesktop.DBus.Python.OSError: Traceback
        String bugId = "1351370";
        try {
            if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
                log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ".  (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
                SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
            } else {
                invokeWorkaroundWhileBugIsOpen = false;
            }
        } catch (BugzillaAPIException be) {
        /* ignore exception */
        } catch (RuntimeException re) {
        /* ignore exception */
        }
        if (invokeWorkaroundWhileBugIsOpen) {
            // this is a workaround as shown in the ADDTIONAL INFO of Bug 1351370 TO RECOVER FROM A BAD STATE
            // Enforcing
            SSHCommandResult selinuxModeResult = client.runCommandAndWait("getenforce");
            client.runCommandAndWait("setenforce Permissive");
            clienttasks.unregister_(null, null, null, null);
            clienttasks.clean_();
            client.runCommandAndWait("setenforce " + selinuxModeResult.getStdout().trim());
        }
    // END OF WORKAROUND
    }
    allProductsSubscribableByOneCommonServiceLevelValue = null;
    allProductsSubscribableByMoreThanOneCommonServiceLevelValues.clear();
}
Also used : SSHCommandResult(com.redhat.qe.tools.SSHCommandResult) BugzillaAPIException(com.redhat.qe.auto.bugzilla.BugzillaAPIException) AfterClass(org.testng.annotations.AfterClass)

Example 54 with AfterClass

use of org.testng.annotations.AfterClass in project incubator-gobblin by apache.

the class DatePartitionedAvroFileExtractorTest method tearDown.

@AfterClass
public void tearDown() throws IOException {
    this.writer.close();
    FileUtils.deleteDirectory(new File(TEST_ROOT_DIR));
}
Also used : File(java.io.File) AfterClass(org.testng.annotations.AfterClass)

Example 55 with AfterClass

use of org.testng.annotations.AfterClass in project incubator-gobblin by apache.

the class TimeBasedAvroWriterPartitionerTest method tearDown.

@AfterClass
public void tearDown() throws IOException {
    this.writer.close();
    FileUtils.deleteDirectory(new File(TEST_ROOT_DIR));
}
Also used : File(java.io.File) AfterClass(org.testng.annotations.AfterClass)

Aggregations

AfterClass (org.testng.annotations.AfterClass)78 File (java.io.File)19 OrganizationConfigManager (com.sun.identity.sm.OrganizationConfigManager)9 HashSet (java.util.HashSet)9 AMIdentity (com.sun.identity.idm.AMIdentity)8 SSOToken (com.iplanet.sso.SSOToken)6 PrivilegeManager (com.sun.identity.entitlement.PrivilegeManager)6 MockParticipantManager (org.apache.helix.integration.manager.MockParticipantManager)6 AMIdentityRepository (com.sun.identity.idm.AMIdentityRepository)5 Date (java.util.Date)5 FutureCallback (com.linkedin.common.callback.FutureCallback)4 None (com.linkedin.common.util.None)4 Client (com.linkedin.r2.transport.common.Client)4 MockServer (com.sequenceiq.it.cloudbreak.v2.mock.MockServer)4 Path (org.apache.hadoop.fs.Path)4 PolicyPrivilegeManager (com.sun.identity.entitlement.opensso.PolicyPrivilegeManager)3 Configuration (org.apache.hadoop.conf.Configuration)3 FileSystem (org.apache.hadoop.fs.FileSystem)3 SSOException (com.iplanet.sso.SSOException)2 TransportClientFactory (com.linkedin.r2.transport.common.TransportClientFactory)2