Search in sources :

Example 11 with AfterClass

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

the class PrivilegePolicyMapping method cleanup.

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

Example 12 with AfterClass

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

the class TestGroupEvaluator 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);
    Set<AMIdentity> identities = new HashSet<AMIdentity>();
    identities.add(user1);
    identities.add(group1);
    IdRepoUtils.deleteIdentities("/", identities);
    ApplicationManager.deleteApplication(adminSubject, "/", APPL_NAME);
}
Also used : PolicyPrivilegeManager(com.sun.identity.entitlement.opensso.PolicyPrivilegeManager) AMIdentity(com.sun.identity.idm.AMIdentity) PolicyPrivilegeManager(com.sun.identity.entitlement.opensso.PolicyPrivilegeManager) HashSet(java.util.HashSet) AfterClass(org.testng.annotations.AfterClass)

Example 13 with AfterClass

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

the class PolicyEvaluatorTest method cleanup.

@AfterClass
public void cleanup() throws PolicyException, SSOException, IdRepoException {
    try {
        lc.logout();
    } catch (Exception e) {
    //ignore
    }
    SSOToken adminToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
    PolicyManager pm = new PolicyManager(adminToken, "/");
    pm.removePolicy(POLICY_NAME1);
    pm.removePolicy(POLICY_NAME2);
    pm.removePolicy(POLICY_NAME3);
    pm.removePolicy(POLICY_NAME4);
    AMIdentityRepository amir = new AMIdentityRepository(adminToken, "/");
    Set<AMIdentity> identities = new HashSet<AMIdentity>();
    identities.add(testGroup);
    identities.add(testUser);
    amir.deleteIdentities(identities);
}
Also used : SSOToken(com.iplanet.sso.SSOToken) AMIdentity(com.sun.identity.idm.AMIdentity) AMIdentityRepository(com.sun.identity.idm.AMIdentityRepository) IdRepoException(com.sun.identity.idm.IdRepoException) SSOException(com.iplanet.sso.SSOException) HashSet(java.util.HashSet) AfterClass(org.testng.annotations.AfterClass)

Example 14 with AfterClass

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

the class ApplicationPrivilegeCLITest method cleanup.

@AfterClass
public void cleanup() throws Exception {
    AMIdentityRepository amir = new AMIdentityRepository(adminToken, "/");
    Set<AMIdentity> identities = new HashSet<AMIdentity>();
    identities.add(user1);
    identities.add(user2);
    amir.deleteIdentities(identities);
}
Also used : AMIdentity(com.sun.identity.idm.AMIdentity) AMIdentityRepository(com.sun.identity.idm.AMIdentityRepository) HashSet(java.util.HashSet) AfterClass(org.testng.annotations.AfterClass)

Example 15 with AfterClass

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

the class ProxyPETest method cleanup.

@AfterClass
public void cleanup() throws PolicyException, SSOException, IdRepoException {
    try {
        lc.logout();
    } catch (Exception e) {
    //ignore
    }
    SSOToken adminToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
    PolicyManager pm = new PolicyManager(adminToken, "/");
    pm.removePolicy(POLICY_NAME1);
    AMIdentityRepository amir = new AMIdentityRepository(adminToken, "/");
    Set<AMIdentity> identities = new HashSet<AMIdentity>();
    identities.add(testUser);
//amir.deleteIdentities(identities);
}
Also used : SSOToken(com.iplanet.sso.SSOToken) AMIdentity(com.sun.identity.idm.AMIdentity) AMIdentityRepository(com.sun.identity.idm.AMIdentityRepository) IdRepoException(com.sun.identity.idm.IdRepoException) SSOException(com.iplanet.sso.SSOException) 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