Search in sources :

Example 21 with Parameters

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

the class IdRepoTest method listIdentities.

@Parameters({ "realm", "uid" })
@Test(groups = { "cli-idrepo", "list-identities" }, dependsOnMethods = { "createIdentity" })
public void listIdentities(String realm, String uid) throws CLIException {
    String[] param = { realm, uid };
    entering("listIdentities", param);
    String[] args = { "list-identities", CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_TYPE, "User", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.FILTER, uid, CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm };
    CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
    cmdManager.addToRequestQueue(req);
    cmdManager.serviceRequestQueue();
    exiting("listIdentities");
}
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 22 with Parameters

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

the class IdRepoTest method getIdentityTypes.

@Parameters({ "realm" })
@Test(groups = { "cli-idrepo", "show-identity-types" })
public void getIdentityTypes(String realm) throws CLIException {
    String[] param = { realm };
    entering("getIdentityTypes", param);
    String[] args = { "show-identity-types", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm };
    CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
    cmdManager.addToRequestQueue(req);
    cmdManager.serviceRequestQueue();
    exiting("getIdentityTypes");
}
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 23 with Parameters

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

the class IdRepoTest method getAttributes.

@Parameters({ "realm", "uid" })
@Test(groups = { "cli-idrepo", "get-identity" }, dependsOnMethods = { "createIdentity" })
public void getAttributes(String realm, String uid) throws CLIException {
    String[] param = { realm, uid };
    entering("getAttributes", param);
    String[] args = { "get-identity", CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_TYPE, "User", CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_NAME, uid, CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm };
    CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
    cmdManager.addToRequestQueue(req);
    cmdManager.serviceRequestQueue();
    exiting("getAttributes");
}
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 24 with Parameters

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

the class IdRepoTest method unassignServices.

@Parameters({ "realm", "uid" })
@Test(groups = { "cli-idrepo", "remove-svc-identity" }, dependsOnMethods = { "setServiceAttributes", "getServiceAttributes", "getAttributes" })
public void unassignServices(String realm, String uid) throws CLIException, IdRepoException, SSOException {
    String[] param = { realm, uid };
    entering("unassignServices", param);
    String[] args = { "remove-svc-identity", CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_TYPE, "User", CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_NAME, uid, CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm, CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SERVICE_NAME, "iPlanetAMSessionService" };
    SSOToken adminSSOToken = getAdminSSOToken();
    CLIRequest req = new CLIRequest(null, args, adminSSOToken);
    cmdManager.addToRequestQueue(req);
    cmdManager.serviceRequestQueue();
    AMIdentity amid = new AMIdentity(adminSSOToken, uid, IdType.USER, realm, null);
    Set services = amid.getAssignedServices();
    for (Iterator i = services.iterator(); i.hasNext(); ) {
        String svc = (String) i.next();
        assert (!svc.equals("iPlanetAMSessionService"));
    }
    exiting("unassignServices");
}
Also used : SSOToken(com.iplanet.sso.SSOToken) HashSet(java.util.HashSet) Set(java.util.Set) AMIdentity(com.sun.identity.idm.AMIdentity) Iterator(java.util.Iterator) 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 25 with Parameters

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

the class ResourceBundleTest method removeResourceBundle.

@Parameters({ "bundle-name", "locale" })
@Test(groups = { "cli-resource-bundle", "remove-res-bundle" }, dependsOnMethods = { "getResourceBundle" })
public void removeResourceBundle(String bundleName, String locale) throws CLIException, SSOException {
    entering("removeResourceBundle", null);
    String[] args = (locale.length() == 0) ? new String[3] : new String[5];
    args[0] = "remove-res-bundle";
    args[1] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.RESOURCE_BUNDLE_NAME;
    args[2] = bundleName;
    if (locale.length() > 0) {
        args[3] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.RESOURCE_BUNDLE_LOCALE;
        args[4] = locale;
    }
    CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
    cmdManager.addToRequestQueue(req);
    cmdManager.serviceRequestQueue();
    try {
        ResourceBundle res = (locale.length() == 0) ? ISResourceBundle.getResourceBundle(getAdminSSOToken(), bundleName, (String) null) : ISResourceBundle.getResourceBundle(getAdminSSOToken(), bundleName, locale);
        assert (res.getLocale() == null);
    } catch (MissingResourceException e) {
    //Ignored
    }
    if (!locale.isEmpty()) {
        //clean up the default resourcebundle too, after removing the JP version
        removeResourceBundle(bundleName, "");
    }
    exiting("removeResourceBundle");
}
Also used : MissingResourceException(java.util.MissingResourceException) ISResourceBundle(com.sun.identity.common.ISResourceBundle) ResourceBundle(java.util.ResourceBundle) Parameters(org.testng.annotations.Parameters) BeforeTest(org.testng.annotations.BeforeTest) Test(org.testng.annotations.Test)

Aggregations

Parameters (org.testng.annotations.Parameters)628 Test (org.testng.annotations.Test)610 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