use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SchemaTest method deleteAttributeSchema.
@Parameters({ "subschema" })
@Test(groups = { "schema", "delete-attr", "subschema" }, dependsOnGroups = { "attribute-schema-ops" })
public void deleteAttributeSchema(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("deleteAttributeSchema", params);
String[] args = (subschema.length() == 0) ? new String[7] : new String[9];
args[0] = "delete-attr";
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";
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");
assert (as == null);
exiting("deleteAttributeSchema");
} catch (CLIException e) {
this.log(Level.SEVERE, "deleteAttributeSchema", e.getMessage());
throw e;
} catch (SMSException e) {
this.log(Level.SEVERE, "deleteAttributeSchema", e.getMessage());
throw e;
} catch (SSOException e) {
this.log(Level.SEVERE, "deleteAttributeSchema", e.getMessage());
throw e;
}
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SchemaTest method setAttributeDefaults.
@Parameters({ "subschema" })
@Test(groups = { "schema", "set-attr-defs", "attribute-schema-ops", "subschema" }, dependsOnMethods = { "deleteAttributeDefaultValues" })
public void setAttributeDefaults(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("setAttributeDefaults", params);
SSOToken adminSSOToken = getAdminSSOToken();
ServiceSchemaManager mgr = new ServiceSchemaManager(TEST_SERVICE, adminSSOToken);
ServiceSchema serviceSchema = mgr.getGlobalSchema();
if (subschema.length() > 0) {
serviceSchema = serviceSchema.getSubSchema(subschema);
}
AttributeSchema as = serviceSchema.getAttributeSchema("mock-add");
as.addChoiceValue("testx", "testx");
//as.addChoiceValue("testy", "testy");
String[] args = (subschema.length() == 0) ? new String[7] : new String[9];
args[0] = "set-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_VALUES;
args[6] = "mock-add=testx";
if (subschema.length() > 0) {
args[7] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SUBSCHEMA_NAME;
args[8] = subschema;
}
CLIRequest req = new CLIRequest(null, args, adminSSOToken);
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
mgr = new ServiceSchemaManager(TEST_SERVICE, adminSSOToken);
serviceSchema = mgr.getGlobalSchema();
if (subschema.length() > 0) {
serviceSchema = serviceSchema.getSubSchema(subschema);
}
as = serviceSchema.getAttributeSchema("mock-add");
Set defaultValues = as.getDefaultValues();
assert (defaultValues.size() == 1);
assert (defaultValues.contains("testx"));
//assert (defaultValues.contains("testy"));
exiting("setAttributeDefaults");
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SchemaTest method deleteAttributeDefaultValues.
@Parameters({ "subschema" })
@Test(groups = { "schema", "add-attribute-default-values", "attribute-schema-ops", "subschema" }, dependsOnMethods = { "showAttributeDefaultValues" })
public void deleteAttributeDefaultValues(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("deleteAttributeDefaultValues", params);
String[] args = (subschema.length() == 0) ? new String[9] : new String[11];
args[0] = "delete-attr-def-values";
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 + IArgument.DEFAULT_VALUES;
args[8] = "test1";
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);
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.contains("test1"));
exiting("deleteAttributeDefaultValues");
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SAML2Test method createMetaTemplate.
@Test(groups = { "samlv2", "samlv2op" }, dependsOnMethods = { "createCircleOfTrust" })
public void createMetaTemplate() throws CLIException {
entering("createMetaTemplate", null);
String[] args = { "create-metadata-templ", CLIConstants.PREFIX_ARGUMENT_LONG + FedCLIConstants.ARGUMENT_ENTITY_ID, NAME_IDP, CLIConstants.PREFIX_ARGUMENT_LONG + FedCLIConstants.ARGUMENT_METADATA, "meta", CLIConstants.PREFIX_ARGUMENT_LONG + FedCLIConstants.ARGUMENT_EXTENDED_DATA, "extended", CLIConstants.PREFIX_ARGUMENT_LONG + FedCLIConstants.ARGUMENT_SERVICE_PROVIDER, "/sp", CLIConstants.PREFIX_ARGUMENT_LONG + FedCLIConstants.ARGUMENT_IDENTITY_PROVIDER, "/idp", CLIConstants.PREFIX_ARGUMENT_LONG + FedCLIConstants.ARGUMENT_PDP, "/pdp", CLIConstants.PREFIX_ARGUMENT_LONG + FedCLIConstants.ARGUMENT_PEP, "/pep", CLIConstants.PREFIX_ARGUMENT_LONG + FedCLIConstants.SPECIFICATION_VERSION, FedCLIConstants.SAML2_SPECIFICATION };
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
exiting("createMetaTemplate");
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SAML2Test method deleteEntity.
@Test(groups = { "samlv2", "samlv2op" }, dependsOnMethods = { "removeProviderFromCircleOfTrust" })
public void deleteEntity() throws CLIException, SAML2MetaException {
entering("deleteEntity", null);
String[] args = { "delete-entity", CLIConstants.PREFIX_ARGUMENT_LONG + FedCLIConstants.ARGUMENT_ENTITY_ID, NAME_IDP, CLIConstants.PREFIX_ARGUMENT_LONG + FedCLIConstants.SPECIFICATION_VERSION, FedCLIConstants.SAML2_SPECIFICATION };
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
SAML2MetaManager mgr = new SAML2MetaManager();
EntityDescriptorElement entity = mgr.getEntityDescriptor("/", NAME_IDP);
assert (entity == null);
exiting("deleteEntity");
}
Aggregations