Search in sources :

Example 6 with AfterClass

use of org.testng.annotations.AfterClass in project rest.li by linkedin.

the class TestCompressionEcho method tearDown.

@AfterClass
public void tearDown() throws Exception {
    for (Client client : _clients) {
        final FutureCallback<None> clientShutdownCallback = new FutureCallback<None>();
        client.shutdown(clientShutdownCallback);
        clientShutdownCallback.get();
    }
    for (TransportClientFactory factory : _clientFactories) {
        final FutureCallback<None> factoryShutdownCallback = new FutureCallback<None>();
        factory.shutdown(factoryShutdownCallback);
        factoryShutdownCallback.get();
    }
    if (_server != null) {
        _server.stop();
        _server.waitForStop();
    }
    _executor.shutdown();
}
Also used : Client(com.linkedin.r2.transport.common.Client) None(com.linkedin.common.util.None) TransportClientFactory(com.linkedin.r2.transport.common.TransportClientFactory) FutureCallback(com.linkedin.common.callback.FutureCallback) AfterClass(org.testng.annotations.AfterClass)

Example 7 with AfterClass

use of org.testng.annotations.AfterClass in project pulsar by yahoo.

the class CallbackMutexTest method teardown.

@AfterClass
public void teardown() {
    Logger log = Logger.getLogger(CallbackMutex.class);
    log.setLevel(Level.OFF);
}
Also used : Logger(org.apache.log4j.Logger) AfterClass(org.testng.annotations.AfterClass)

Example 8 with AfterClass

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

the class PolicyIndexTest method cleanup.

@AfterClass
public void cleanup() throws SSOException, PolicyException {
    SSOToken adminToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
    PolicyManager pm = new PolicyManager(adminToken, "/");
    pm.removePolicy(POLICY_NAME);
}
Also used : SSOToken(com.iplanet.sso.SSOToken) AfterClass(org.testng.annotations.AfterClass)

Example 9 with AfterClass

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

the class TestAttributeEvaluator method cleanup.

@AfterClass
public void cleanup() throws Exception {
    if (!migrated) {
        return;
    }
    PrivilegeManager pm = new PolicyPrivilegeManager(applicationServiceFactory, resourceTypeService, constraintValidator);
    pm.initialize("/", SubjectUtils.createSubject(adminToken));
    pm.remove(PRIVILEGE1_NAME);
    IdRepoUtils.deleteIdentity("/", user1);
    ApplicationManager.deleteApplication(adminSubject, "/", APPL_NAME);
}
Also used : PolicyPrivilegeManager(com.sun.identity.entitlement.opensso.PolicyPrivilegeManager) PolicyPrivilegeManager(com.sun.identity.entitlement.opensso.PolicyPrivilegeManager) AfterClass(org.testng.annotations.AfterClass)

Example 10 with AfterClass

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

the class TestEvaluator method cleanup.

@AfterClass
public void cleanup() throws Exception {
    if (!migrated) {
        return;
    }
    PrivilegeManager pm = PrivilegeManager.getInstance(SUB_REALM, adminSubject);
    pm.remove(PRIVILEGE1_NAME);
    Set<AMIdentity> identities = new HashSet<AMIdentity>();
    identities.add(user1);
    identities.add(user2);
    IdRepoUtils.deleteIdentities("/", identities);
    ApplicationManager.deleteApplication(adminSubject, "/", APPL_NAME);
    OrganizationConfigManager orgMgr = new OrganizationConfigManager(adminToken, "/");
    orgMgr.deleteSubOrganization(SUB_REALM, true);
}
Also used : AMIdentity(com.sun.identity.idm.AMIdentity) OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) 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