Search in sources :

Example 31 with Parameters

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

the class AMIdentityTestBase method createIdentityWithLongName.

/**
     * Creates <code>AMIdentity</code> twice with long name.
     *
     * @throws IdRepoException if <code>AMIdentity</code> object cannot be
     *         created.
     * @throws SSOException if the super administrator Single Sign On is 
     *         invalid. 
     */
@Parameters({ "parent-realm", "entity-type", "entity-name", "entity-creation-attributes" })
@Test(groups = { "api" })
public void createIdentityWithLongName(String parentRealm, String idType, String entityName, String createAttributes) throws IdRepoException, SSOException {
    Object[] params = { parentRealm, idType, entityName, createAttributes };
    entering("createIdentityWithLongName", params);
    try {
        String name = entityName;
        for (int i = 0; i < 100; i++) {
            name += entityName;
        }
        IdType type = IdUtils.getType(idType);
        Map values = CollectionUtils.parseStringToMap(createAttributes);
        createIdentity(parentRealm, type, name, values);
        deleteIdentity(parentRealm, type, name);
    } catch (SSOException e) {
        log(Level.SEVERE, "createIdentityWithLongName", e.getMessage(), params);
        e.printStackTrace();
        throw e;
    }
    exiting("createIdentityWithLongName");
}
Also used : SSOException(com.iplanet.sso.SSOException) HashMap(java.util.HashMap) Map(java.util.Map) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) BeforeTest(org.testng.annotations.BeforeTest)

Example 32 with Parameters

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

the class RealmTest method getRealmAttributeValues.

@Parameters({ "realm" })
@Test(groups = { "cli-realm", "get-realm" })
public void getRealmAttributeValues(String realm) throws CLIException {
    String[] param = { realm };
    entering("getRealmAttributeValues", param);
    String[] args = { "get-realm", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, "/", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SERVICE_NAME, "sunIdentityRepositoryService" };
    CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
    cmdManager.addToRequestQueue(req);
    cmdManager.serviceRequestQueue();
    exiting("getRealmAttributeValues");
}
Also used : CLIRequest(com.sun.identity.cli.CLIRequest) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest) AfterTest(org.testng.annotations.AfterTest)

Example 33 with Parameters

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

the class RealmTest method listRealms.

@Parameters({ "parent-realm" })
@Test(groups = { "cli-realm", "list-realms" })
public void listRealms(String parentRealm) throws CLIException, SMSException {
    String[] param = { parentRealm };
    entering("listRealms", param);
    String[] args = { "list-realms", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.FILTER, "*", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, parentRealm };
    CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
    cmdManager.addToRequestQueue(req);
    cmdManager.serviceRequestQueue();
    exiting("listRealms");
}
Also used : CLIRequest(com.sun.identity.cli.CLIRequest) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest) AfterTest(org.testng.annotations.AfterTest)

Example 34 with Parameters

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

the class RealmTest method getAssignableServicesInRealm.

@Parameters({ "realm" })
@Test(groups = { "cli-realm", "list-realm-assignable-svcs" })
public void getAssignableServicesInRealm(String realm) throws CLIException, SMSException {
    String[] param = { realm };
    entering("getAssignableServicesInRealm", param);
    String[] args = { "list-realm-assignable-svcs", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm };
    CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
    cmdManager.addToRequestQueue(req);
    cmdManager.serviceRequestQueue();
    exiting("getAssignableServicesInRealm");
}
Also used : CLIRequest(com.sun.identity.cli.CLIRequest) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest) AfterTest(org.testng.annotations.AfterTest)

Example 35 with Parameters

use of org.testng.annotations.Parameters 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)

Aggregations

Parameters (org.testng.annotations.Parameters)630 Test (org.testng.annotations.Test)608 BaseTest (org.xdi.oxauth.BaseTest)511 Response (javax.ws.rs.core.Response)271 Builder (javax.ws.rs.client.Invocation.Builder)270 ResteasyClientBuilder (org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder)270 ResponseType (org.xdi.oxauth.model.common.ResponseType)259 JSONException (org.codehaus.jettison.json.JSONException)238 OxAuthCryptoProvider (org.xdi.oxauth.model.crypto.OxAuthCryptoProvider)196 JSONObject (org.codehaus.jettison.json.JSONObject)191 URISyntaxException (java.net.URISyntaxException)119 RegisterResponse (org.xdi.oxauth.client.RegisterResponse)110 RegisterRequest (org.xdi.oxauth.client.RegisterRequest)96 JwtAuthorizationRequest (org.xdi.oxauth.client.model.authorize.JwtAuthorizationRequest)92 AuthorizationRequest (org.xdi.oxauth.client.AuthorizationRequest)86 URI (java.net.URI)85 Jwt (org.xdi.oxauth.model.jwt.Jwt)81 Claim (org.xdi.oxauth.client.model.authorize.Claim)80 MultivaluedHashMap (javax.ws.rs.core.MultivaluedHashMap)73 REGISTRATION_CLIENT_URI (org.xdi.oxauth.model.register.RegisterResponseParam.REGISTRATION_CLIENT_URI)73