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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations