Search in sources :

Example 1 with AfterTest

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);
}
Also used : AMIdentity(com.sun.identity.idm.AMIdentity) OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) HashSet(java.util.HashSet) AfterTest(org.testng.annotations.AfterTest)

Example 2 with AfterTest

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");
}
Also used : Set(java.util.Set) OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) CLIRequest(com.sun.identity.cli.CLIRequest) Parameters(org.testng.annotations.Parameters) AfterTest(org.testng.annotations.AfterTest)

Example 3 with AfterTest

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;
}
Also used : ReleaseContext(iso.std.iso_iec._24727.tech.schema.ReleaseContext) AfterTest(org.testng.annotations.AfterTest)

Example 4 with AfterTest

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");
}
Also used : SSOToken(com.iplanet.sso.SSOToken) HashSet(java.util.HashSet) Set(java.util.Set) IdSearchResults(com.sun.identity.idm.IdSearchResults) AMIdentityRepository(com.sun.identity.idm.AMIdentityRepository) IdSearchControl(com.sun.identity.idm.IdSearchControl) CLIRequest(com.sun.identity.cli.CLIRequest) Parameters(org.testng.annotations.Parameters) AfterTest(org.testng.annotations.AfterTest)

Example 5 with AfterTest

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());
}
Also used : File(java.io.File) AfterTest(org.testng.annotations.AfterTest)

Aggregations

AfterTest (org.testng.annotations.AfterTest)8 CLIRequest (com.sun.identity.cli.CLIRequest)2 OrganizationConfigManager (com.sun.identity.sm.OrganizationConfigManager)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 Parameters (org.testng.annotations.Parameters)2 SSOToken (com.iplanet.sso.SSOToken)1 PropertyEventThread (com.linkedin.d2.discovery.event.PropertyEventThread)1 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)1 AMIdentity (com.sun.identity.idm.AMIdentity)1 AMIdentityRepository (com.sun.identity.idm.AMIdentityRepository)1 IdSearchControl (com.sun.identity.idm.IdSearchControl)1 IdSearchResults (com.sun.identity.idm.IdSearchResults)1 ReleaseContext (iso.std.iso_iec._24727.tech.schema.ReleaseContext)1 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 InputStreamReader (java.io.InputStreamReader)1 CountDownLatch (java.util.concurrent.CountDownLatch)1