use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SetApplicationTest method modifyApp.
@Test
public void modifyApp() throws CLIException {
String[] args = new String[16];
args[0] = "set-appl";
args[1] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME;
args[2] = "/";
args[3] = CLIConstants.PREFIX_ARGUMENT_LONG + CreateApplication.PARAM_APPL_NAME;
args[4] = APPL_NAME;
args[5] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.ATTRIBUTE_VALUES;
args[6] = CreateApplication.ATTR_ACTIONS + "=GET=true";
args[7] = CreateApplication.ATTR_ACTIONS + "=POST=true";
args[8] = CreateApplication.ATTR_CONDITIONS + "=com.sun.identity.admin.model.DateRangeCondition";
args[9] = CreateApplication.ATTR_SUBJECTS + "=com.sun.identity.admin.model.IdRepoGroupViewSubject";
args[10] = CreateApplication.ATTR_RESOURCES + "=https://";
args[11] = CreateApplication.ATTR_SUBJECT_ATTRIBUTE_NAMES + "=uid";
args[12] = CreateApplication.ATTR_ENTITLEMENT_COMBINER + "=com.sun.identity.entitlement.DenyOverride";
args[13] = CreateApplication.ATTR_RESOURCE_COMPARATOR + "=com.sun.identity.entitlement.URLResourceName";
args[14] = CreateApplication.ATTR_SAVE_INDEX + "=com.sun.identity.entitlement.util.ResourceNameIndexGenerator";
args[15] = CreateApplication.ATTR_SEARCH_INDEX + "=com.sun.identity.entitlement.util.ResourceNameSplitter";
CLIRequest req = new CLIRequest(null, args, adminToken);
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
}
use of com.sun.identity.cli.CLIRequest 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");
}
use of com.sun.identity.cli.CLIRequest 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");
}
use of com.sun.identity.cli.CLIRequest 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");
}
use of com.sun.identity.cli.CLIRequest 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");
}
Aggregations