use of org.testng.annotations.AfterTest in project OpenAM by OpenRock.
the class DelegationPrivilegeIdRepoAccessTest method cleanup.
@AfterTest
public void cleanup() throws Exception {
Set<AMIdentity> identities = new HashSet<AMIdentity>();
identities.add(delegatedUser);
identities.add(delegatedUser1);
IdRepoUtils.deleteIdentities(SUB_REALM, identities);
ApplicationManager.deleteApplication(SubjectUtils.createSuperAdminSubject(), SUB_REALM, APPLICATION_NAME);
OrganizationConfigManager orgMgr = new OrganizationConfigManager(adminToken, "/");
orgMgr.deleteSubOrganization(SUB_REALM, true);
}
use of org.testng.annotations.AfterTest in project OpenAM by OpenRock.
the class RealmTest method deleteRealm.
@Parameters({ "realm" })
@AfterTest(groups = { "cli-realm", "delete-realm" })
public void deleteRealm(String realm) throws CLIException, SMSException {
String[] param = { realm };
entering("deleteRealm", param);
String[] args = { "delete-realm", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm };
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
String parentRealm = RealmUtils.getParentRealm(realm);
String realmName = RealmUtils.getChildRealm(realm);
OrganizationConfigManager ocm = new OrganizationConfigManager(getAdminSSOToken(), parentRealm);
Set results = ocm.getSubOrganizationNames(realmName, false);
assert (results.isEmpty());
exiting("deleteRealm");
}
use of org.testng.annotations.AfterTest in project open-ecard by ecsec.
the class TerminalTest method kill.
@AfterTest
public void kill() {
if (ifd != null) {
ReleaseContext rCtx = new ReleaseContext();
rCtx.setContextHandle(ctxHandle);
ifd.releaseContext(rCtx);
}
ifd = null;
}
use of org.testng.annotations.AfterTest in project OpenAM by OpenRock.
the class IdRepoTest method deleteIdentity.
@Parameters({ "realm", "uid" })
@AfterTest(groups = { "cli-idrepo", "delete-identities" })
public void deleteIdentity(String realm, String uid) throws CLIException, IdRepoException, SSOException {
String[] param = { realm, uid };
entering("deleteRealm", param);
String[] args = { "delete-identities", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm, CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_TYPE, "User", CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_NAMES, uid };
SSOToken adminSSOToken = getAdminSSOToken();
CLIRequest req = new CLIRequest(null, args, adminSSOToken);
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
AMIdentityRepository amir = new AMIdentityRepository(adminSSOToken, realm);
IdSearchControl isCtl = new IdSearchControl();
IdSearchResults isr = amir.searchIdentities(IdType.USER, uid, isCtl);
Set results = isr.getSearchResults();
assert (results.isEmpty());
exiting("deleteIdentities");
}
use of org.testng.annotations.AfterTest in project Payara by payara.
the class BasicCDITest method afterTest.
@AfterTest
public void afterTest() throws NamingException {
if (deployed1) {
NucleusTestUtils.nadmin("undeploy", EJB1_APP_NAME);
deployed1 = false;
}
if (context != null) {
context.close();
context = null;
}
// After the undeployment the file indicating the proper destruction should be there
File destroyedFile = new File(GLASSFISH_HOME);
destroyedFile = new File(destroyedFile, RELATIVE_FILE_PATH);
Assert.assertTrue(destroyedFile.exists());
}
Aggregations