use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class IdRepoTest method getServiceAttributes.
@Parameters({ "realm", "uid" })
@Test(groups = { "cli-idrepo", "show-identity-svc-attrs" }, dependsOnMethods = { "assignServices" })
public void getServiceAttributes(String realm, String uid) throws CLIException, IdRepoException, SSOException {
String[] param = { realm, uid };
entering("getServiceAttributes", param);
String[] args = { "show-identity-svc-attrs", 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();
exiting("getServiceAttributes");
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class IdRepoTest method getIdentityOperations.
@Parameters({ "realm" })
@Test(groups = { "cli-idrepo", "show-identity-ops" })
public void getIdentityOperations(String realm) throws CLIException {
String[] param = { realm };
entering("getIdentityOperations", param);
String[] args = { "show-identity-ops", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm, CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_TYPE, "User" };
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
exiting("getIdentityOperations");
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class IdRepoTest method removeMember.
@Parameters({ "realm", "uid" })
@Test(groups = { "cli-idrepo", "add-members" }, dependsOnMethods = { "addMember" })
public void removeMember(String realm, String uid) throws CLIException, IdRepoException, SSOException {
String[] param = { realm, uid };
entering("removeMember", param);
String[] args = { "remove-member", CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_TYPE, "Group", CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_NAME, DUMMY_GROUP, CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_MEMBER_IDNAME, uid, CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_MEMBER_IDTYPE, "User", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm };
SSOToken adminSSOToken = getAdminSSOToken();
CLIRequest req = new CLIRequest(null, args, adminSSOToken);
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
AMIdentity group = new AMIdentity(adminSSOToken, DUMMY_GROUP, IdType.GROUP, realm, null);
Set members = group.getMembers(IdType.USER);
for (Iterator i = members.iterator(); i.hasNext(); ) {
AMIdentity x = (AMIdentity) i.next();
assert (!x.getName().equals(uid));
}
deleteDummyGroup(realm);
exiting("removeMember");
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SchemaTest method showAttributeDefaultValues.
@Parameters({ "subschema" })
@Test(groups = { "schema", "show-attr-defs", "attribute-schema-ops", "subschema" }, dependsOnMethods = { "addAttributeDefaultValues" })
public void showAttributeDefaultValues(String subschema) throws CLIException {
Object[] params = { subschema };
entering("showAttributeDefaultValues", params);
String[] args = (subschema.length() == 0) ? new String[7] : new String[9];
args[0] = "get-attr-defs";
args[1] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SERVICE_NAME;
args[2] = TEST_SERVICE;
args[3] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SCHEMA_TYPE;
args[4] = "global";
args[5] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.ATTRIBUTE_NAMES;
args[6] = "mock-add";
if (subschema.length() > 0) {
args[7] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SUBSCHEMA_NAME;
args[8] = subschema;
}
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
try {
cmdManager.serviceRequestQueue();
String messages = outputWriter.getMessages();
assert (messages.indexOf("mock-add=test1") != -1);
} catch (CLIException e) {
this.log(Level.SEVERE, "showAttributeDefaultValues", e.getMessage());
throw e;
}
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SchemaTest method setAttributeSchemaUIType.
@Parameters({ "subschema" })
@Test(groups = { "schema", "set-attr-ui-type", "attribute-schema-ops", "subschema" }, dependsOnMethods = { "addAttributeSchema", "showAttributeDefaultValues" })
public void setAttributeSchemaUIType(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("setAttributeSchemaUIType", params);
String[] args = (subschema.length() == 0) ? new String[9] : new String[11];
args[0] = "set-attr-ui-type";
args[1] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SERVICE_NAME;
args[2] = TEST_SERVICE;
args[3] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SCHEMA_TYPE;
args[4] = "global";
args[5] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.ATTRIBUTE_SCHEMA;
args[6] = "mock-add";
args[7] = CLIConstants.PREFIX_ARGUMENT_LONG + ModifyAttributeSchemaUIType.ARGUMENT_UI_TYPE;
args[8] = "button";
if (subschema.length() > 0) {
args[9] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SUBSCHEMA_NAME;
args[10] = subschema;
}
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
try {
cmdManager.serviceRequestQueue();
ServiceSchemaManager mgr = new ServiceSchemaManager(TEST_SERVICE, getAdminSSOToken());
ServiceSchema serviceSchema = mgr.getGlobalSchema();
if (subschema.length() > 0) {
serviceSchema = serviceSchema.getSubSchema(subschema);
}
AttributeSchema as = serviceSchema.getAttributeSchema("mock-add");
assert (as.getUIType().equals(AttributeSchema.UIType.BUTTON));
exiting("setAttributeSchemaUIType");
} catch (CLIException e) {
this.log(Level.SEVERE, "setAttributeSchemaUIType", e.getMessage());
throw e;
} catch (SMSException e) {
this.log(Level.SEVERE, "setAttributeSchemaUIType", e.getMessage());
throw e;
} catch (SSOException e) {
this.log(Level.SEVERE, "setAttributeSchemaUIType", e.getMessage());
throw e;
}
}
Aggregations