use of org.testng.annotations.Parameters in project OpenAM by OpenRock.
the class RealmTest method getServiceAttribute.
@Parameters({ "realm", "service-name" })
@Test(groups = { "cli-realm", "services", "show-realm-svc-attrs" }, dependsOnMethods = { "assignedServiceToRealm" })
public void getServiceAttribute(String realm, String serviceName) throws CLIException {
String[] param = { realm };
entering("getServiceAttribute", param);
String[] args = { "get-realm-svc-attrs", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm, CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SERVICE_NAME, serviceName };
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
exiting("getServiceAttribute");
}
use of org.testng.annotations.Parameters in project OpenAM by OpenRock.
the class RealmTest method unassignServiceFromRealm.
@Parameters({ "realm", "service-name", "attribute-value" })
@Test(groups = { "cli-realm", "remove-svc-realm" }, dependsOnGroups = { "services" })
public void unassignServiceFromRealm(String realm, String serviceName, String attributeValue) throws CLIException, IdRepoException, SSOException {
String[] param = { realm };
entering("unassignServiceFromRealm", param);
String[] args = { "remove-svc-realm", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm, CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SERVICE_NAME, serviceName };
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
AMIdentityRepository amir = new AMIdentityRepository(getAdminSSOToken(), realm);
AMIdentity ai = amir.getRealmIdentity();
Map map = ai.getServiceAttributes(serviceName);
Map orig = CollectionUtils.parseStringToMap(attributeValue);
assert !map.equals(orig);
exiting("unassignServiceFromRealm");
}
use of org.testng.annotations.Parameters in project OpenAM by OpenRock.
the class SchemaTest method removeAttributeDefaultValues.
@Parameters({ "subschema" })
@Test(groups = { "schema", "remove-attr-defs", "attribute-schema-ops", "subschema" }, dependsOnMethods = { "showAttributeDefaultValues" })
public void removeAttributeDefaultValues(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("removeAttributeDefaultValues", params);
String[] args = (subschema.length() == 0) ? new String[7] : new String[9];
args[0] = "remove-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();
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");
Set values = as.getDefaultValues();
assert values.isEmpty();
exiting("removeAttributeDefaultValues");
} catch (CLIException e) {
this.log(Level.SEVERE, "removeAttributeDefaultValues", e.getMessage());
throw e;
} catch (SMSException e) {
this.log(Level.SEVERE, "removeAttributeDefaultValues", e.getMessage());
throw e;
} catch (SSOException e) {
this.log(Level.SEVERE, "removeAttributeDefaultValues", e.getMessage());
throw e;
}
}
use of org.testng.annotations.Parameters in project OpenAM by OpenRock.
the class IdRepoTest method getAssignableServices.
// Duplicate of getIdentityServices?
// @Parameters ({"realm", "uid"})
// @Test(groups = {"cli-idrepo", "get-identity-svcs"},
// dependsOnMethods = {"createIdentity"})
// public void getServices(String realm, String uid)
// throws CLIException {
// String[] param = {realm, uid};
// entering("getServices", param);
// String[] args = {
// "get-identity-svcs",
// 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("getServices");
// }
@Parameters({ "realm", "uid" })
@Test(groups = { "cli-idrepo", "list-identity-assignable-svcs" }, dependsOnMethods = { "createIdentity" })
public void getAssignableServices(String realm, String uid) throws CLIException {
String[] param = { realm, uid };
entering("getAssignableServices", param);
String[] args = { "list-identity-assignable-svcs", 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("getAssignableServices");
}
use of org.testng.annotations.Parameters in project OpenAM by OpenRock.
the class IdRepoTest method assignServices.
@Parameters({ "realm", "uid" })
@Test(groups = { "cli-idrepo", "add-svc-identity" }, dependsOnMethods = { "createIdentity" })
public void assignServices(String realm, String uid) throws CLIException, IdRepoException, SSOException {
String[] param = { realm, uid };
entering("assignServices", param);
String[] args = { "add-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", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.ATTRIBUTE_VALUES, "iplanet-am-session-quota-limit=10" };
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();
assert services.contains("iPlanetAMSessionService");
exiting("assignServices");
}
Aggregations