use of com.sun.identity.sm.ServiceSchema in project OpenAM by OpenRock.
the class SchemaTest method setAttributeSchemaEndRange.
@Parameters({ "subschema" })
@Test(groups = { "schema", "set-attr-end-range", "subschema" })
public void setAttributeSchemaEndRange(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("setAttributeSchemaEndRange", params);
String[] args = (subschema.length() == 0) ? new String[9] : new String[11];
args[0] = "set-attr-end-range";
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-number";
args[7] = CLIConstants.PREFIX_ARGUMENT_LONG + SetAttributeSchemaEndRange.ARGUMENT_RANGE;
args[8] = "100";
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-number");
assert as.getEndRange().equals("100");
exiting("setAttributeSchemaEndRange");
} catch (CLIException e) {
this.log(Level.SEVERE, "setAttributeSchemaEndRange", e.getMessage());
throw e;
} catch (SMSException e) {
this.log(Level.SEVERE, "setAttributeSchemaEndRange", e.getMessage());
throw e;
} catch (SSOException e) {
this.log(Level.SEVERE, "setAttributeSchemaEndRange", e.getMessage());
throw e;
}
}
use of com.sun.identity.sm.ServiceSchema in project OpenAM by OpenRock.
the class SchemaTest method setAttributeViewBeanURL.
@Parameters({ "subschema" })
@Test(groups = { "schema", "set-attr-view-bean-url", "attribute-schema-ops", "subschema" }, dependsOnMethods = { "addAttributeSchema" })
public void setAttributeViewBeanURL(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("setAttributeViewBeanURL", params);
String[] args = (subschema.length() == 0) ? new String[9] : new String[11];
args[0] = "set-attr-view-bean-url";
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 + ModifyAttributeSchemaPropertiesViewBeanURL.ARGUMENT_URL;
args[8] = "mockattributeURL";
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.getPropertiesViewBeanURL().equals("mockattributeURL"));
exiting("setAttributeViewBeanURL");
} catch (CLIException e) {
this.log(Level.SEVERE, "setAttributeViewBeanURL", e.getMessage());
throw e;
} catch (SMSException e) {
this.log(Level.SEVERE, "setAttributeViewBeanURL", e.getMessage());
throw e;
} catch (SSOException e) {
this.log(Level.SEVERE, "setAttributeViewBeanURL", e.getMessage());
throw e;
}
}
use of com.sun.identity.sm.ServiceSchema in project OpenAM by OpenRock.
the class SchemaTest method setAttributeSchemaSyntax.
@Parameters({ "subschema" })
@Test(groups = { "schema", "set-attr-syntax", "attribute-schema-ops", "subschema" }, dependsOnMethods = { "addAttributeSchema", "showAttributeDefaultValues" })
public void setAttributeSchemaSyntax(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("setAttributeSchemaSyntax", params);
String[] args = (subschema.length() == 0) ? new String[9] : new String[11];
args[0] = "set-attr-syntax";
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 + ModifyAttributeSchemaSyntax.ARGUMENT_SYNTAX;
args[8] = "paragraph";
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.getSyntax().equals(AttributeSchema.Syntax.PARAGRAPH));
exiting("setAttributeSchemaSyntax");
} catch (CLIException e) {
this.log(Level.SEVERE, "setAttributeSchemaSyntax", e.getMessage());
throw e;
} catch (SMSException e) {
this.log(Level.SEVERE, "setAttributeSchemaSyntax", e.getMessage());
throw e;
} catch (SSOException e) {
this.log(Level.SEVERE, "setAttributeSchemaSyntax", e.getMessage());
throw e;
}
}
use of com.sun.identity.sm.ServiceSchema in project OpenAM by OpenRock.
the class SchemaTest method setAttributeSchemaBooleanValues.
@Parameters({ "subschema" })
@Test(groups = { "schema", "set-attr-bool-values", "subschema" })
public void setAttributeSchemaBooleanValues(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("setAttributeSchemaBooleanValues", params);
String[] args = (subschema.length() == 0) ? new String[15] : new String[17];
args[0] = "set-attr-bool-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_NAME;
args[6] = "mock-boolean";
args[7] = CLIConstants.PREFIX_ARGUMENT_LONG + SetAttributeSchemaBooleanValues.ARGUMENT_TRUE_VALUE;
args[8] = "true";
args[9] = CLIConstants.PREFIX_ARGUMENT_LONG + SetAttributeSchemaBooleanValues.ARGUMENT_TRUE_I18N_KEY;
args[10] = "truei18nKey";
args[11] = CLIConstants.PREFIX_ARGUMENT_LONG + SetAttributeSchemaBooleanValues.ARGUMENT_FALSE_VALUE;
args[12] = "false";
args[13] = CLIConstants.PREFIX_ARGUMENT_LONG + SetAttributeSchemaBooleanValues.ARGUMENT_FALSE_I18N_KEY;
args[14] = "falsei18nKey";
if (subschema.length() > 0) {
args[15] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SUBSCHEMA_NAME;
args[16] = 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-boolean");
assert (as.getTrueValue().equals("true"));
assert (as.getTrueValueI18NKey().equals("truei18nKey"));
assert (as.getFalseValue().equals("false"));
assert (as.getFalseValueI18NKey().equals("falsei18nKey"));
exiting("setAttributeSchemaBooleanValues");
} catch (CLIException e) {
this.log(Level.SEVERE, "setAttributeSchemaBooleanValues", e.getMessage());
throw e;
} catch (SMSException e) {
this.log(Level.SEVERE, "setAttributeSchemaBooleanValues", e.getMessage());
throw e;
} catch (SSOException e) {
this.log(Level.SEVERE, "setAttributeSchemaBooleanValues", e.getMessage());
throw e;
}
}
use of com.sun.identity.sm.ServiceSchema in project OpenAM by OpenRock.
the class SchemaTest method setAttributeSchemaType.
@Parameters({ "subschema" })
@Test(groups = { "schema", "set-attr-type", "attribute-schema-ops", "subschema" }, dependsOnMethods = { "addAttributeSchema", "showAttributeDefaultValues" })
public void setAttributeSchemaType(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("setAttributeSchemaType", params);
String[] args = (subschema.length() == 0) ? new String[9] : new String[11];
args[0] = "set-attr-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 + ModifyAttributeSchemaType.ARGUMENT_TYPE;
args[8] = "multiple_choice";
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.getType().equals(AttributeSchema.Type.MULTIPLE_CHOICE));
exiting("setAttributeSchemaType");
} catch (CLIException e) {
this.log(Level.SEVERE, "setAttributeSchemaType", e.getMessage());
throw e;
} catch (SMSException e) {
this.log(Level.SEVERE, "setAttributeSchemaType", e.getMessage());
throw e;
} catch (SSOException e) {
this.log(Level.SEVERE, "setAttributeSchemaType", e.getMessage());
throw e;
}
}
Aggregations