Search in sources :

Example 21 with AfterClass

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

the class ReferralPrivilegeTest method cleanup.

@AfterClass
public void cleanup() throws Exception {
    if (!migrated) {
        return;
    }
    IdRepoUtils.deleteIdentity("/", user);
    OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
    ocm.deleteSubOrganization(SUB_REALM1.substring(1), true);
    ocm.deleteSubOrganization(SUB_REALM2.substring(1), true);
}
Also used : OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) AfterClass(org.testng.annotations.AfterClass)

Example 22 with AfterClass

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

the class ApplicationCacheAfterRealmChangeTest method cleanup.

@AfterClass
public void cleanup() throws Exception {
    if (!migrated) {
        return;
    }
    OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
    String subRealm = SUB_REALM.substring(1);
    ocm.deleteSubOrganization(subRealm, true);
    setOrgAlias(false);
}
Also used : OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) AfterClass(org.testng.annotations.AfterClass)

Example 23 with AfterClass

use of org.testng.annotations.AfterClass in project sakuli by ConSol.

the class LoggerTest method clean.

@AfterClass
public void clean() throws IOException {
    Path logFile = Paths.get(properties.getLogFile());
    deleteFile(logFile);
    deleteFile(logFile.getParent());
}
Also used : Path(java.nio.file.Path) AfterClass(org.testng.annotations.AfterClass)

Example 24 with AfterClass

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

the class HybridClusterIntegrationTest method tearDown.

@AfterClass
public void tearDown() throws Exception {
    // Try deleting the tables and check that they have no routing table
    dropOfflineTable(getTableName());
    dropRealtimeTable(getTableName());
    long endTime = System.currentTimeMillis() + 15000;
    boolean isRoutingTableEmpty = false;
    JSONObject routingTableSnapshot = null;
    while (System.currentTimeMillis() < endTime) {
        try {
            routingTableSnapshot = getDebugInfo("debug/routingTable/" + getTableName());
            if (routingTableSnapshot.getJSONArray("routingTableSnapshot").length() == 0) {
                isRoutingTableEmpty = true;
                break;
            }
        } catch (Exception e) {
        // Will retry in a bit
        }
        Uninterruptibles.sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
    }
    Assert.assertTrue(isRoutingTableEmpty, "Routing table is not empty, last snapshot is " + routingTableSnapshot.toString());
    stopBroker();
    stopController();
    stopServer();
    KafkaStarterUtils.stopServer(kafkaStarter);
    try {
        stopZk();
    } catch (Exception e) {
    // Swallow ZK Exceptions.
    }
    cleanup();
}
Also used : JSONObject(org.json.JSONObject) AfterClass(org.testng.annotations.AfterClass)

Example 25 with AfterClass

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

the class IDPPTest method cleanup.

@AfterClass
public void cleanup() throws Exception {
    if (!migrated) {
        return;
    }
    PolicyManager policyMgr = new PolicyManager(adminToken, orgName);
    policyMgr.removePolicy("IDPPTestPolicy1");
    Set<AMIdentity> identities = new HashSet<AMIdentity>();
    identities.add(user1);
    identities.add(group1);
    IdRepoUtils.deleteIdentities(orgName, identities);
}
Also used : PolicyManager(com.sun.identity.policy.PolicyManager) AMIdentity(com.sun.identity.idm.AMIdentity) HashSet(java.util.HashSet) AfterClass(org.testng.annotations.AfterClass)

Aggregations

AfterClass (org.testng.annotations.AfterClass)37 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 AMIdentityRepository (com.sun.identity.idm.AMIdentityRepository)5 File (java.io.File)4 PolicyPrivilegeManager (com.sun.identity.entitlement.opensso.PolicyPrivilegeManager)3 SSOException (com.iplanet.sso.SSOException)2 FutureCallback (com.linkedin.common.callback.FutureCallback)2 None (com.linkedin.common.util.None)2 Client (com.linkedin.r2.transport.common.Client)2 TransportClientFactory (com.linkedin.r2.transport.common.TransportClientFactory)2 IdRepoException (com.sun.identity.idm.IdRepoException)2 PolicyManager (com.sun.identity.policy.PolicyManager)2 Path (java.nio.file.Path)1 Set (java.util.Set)1 KafkaServerStartable (kafka.server.KafkaServerStartable)1 Logger (org.apache.log4j.Logger)1