use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SAML2Test method deleteCircleOfTrust.
@Test(groups = { "samlv2" }, dependsOnMethods = { "removeProviderFromCircleOfTrust" }, expectedExceptions = { COTException.class })
public void deleteCircleOfTrust() throws CLIException, COTException, SAML2MetaException {
entering("deleteCircleOfTrust", null);
String[] args = { "delete-cot", CLIConstants.PREFIX_ARGUMENT_LONG + FedCLIConstants.ARGUMENT_COT, NAME_COT };
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
try {
cmdManager.serviceRequestQueue();
CircleOfTrustManager cotManager = new CircleOfTrustManager();
CircleOfTrustDescriptor objCircleOfTrust = cotManager.getCircleOfTrust("/", NAME_COT);
} finally {
exiting("deleteCircleOfTrust");
}
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SchemaTest method setServiceViewBeanURL.
@Test(groups = { "schema", "set-svc-view-bean-url" })
public void setServiceViewBeanURL() throws CLIException, SMSException, SSOException {
entering("setServiceViewBeanURL", null);
String[] args = { "set-svc-view-bean-url", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SERVICE_NAME, TEST_SERVICE, CLIConstants.PREFIX_ARGUMENT_LONG + SetServiceSchemaPropertiesViewBeanURL.ARGUMENT_URL, "mockviewbeanURL" };
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
try {
cmdManager.serviceRequestQueue();
ServiceSchemaManager mgr = new ServiceSchemaManager(TEST_SERVICE, getAdminSSOToken());
assert mgr.getPropertiesViewBeanURL().equals("mockviewbeanURL");
exiting("setServiceViewBeanURL");
} catch (CLIException e) {
this.log(Level.SEVERE, "setServiceViewBeanURL", e.getMessage());
throw e;
} catch (SMSException e) {
this.log(Level.SEVERE, "setServiceViewBeanURL", e.getMessage());
throw e;
} catch (SSOException e) {
this.log(Level.SEVERE, "setServiceViewBeanURL", e.getMessage());
throw e;
}
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SchemaTest method setAttributeSchemaStartRange.
@Parameters({ "subschema" })
@Test(groups = { "schema", "set-attr-start-range", "subschema" })
public void setAttributeSchemaStartRange(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("setAttributeSchemaStartRange", params);
String[] args = (subschema.length() == 0) ? new String[9] : new String[11];
args[0] = "set-attr-start-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 + SetAttributeSchemaStartRange.ARGUMENT_RANGE;
args[8] = "10";
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.getStartRange().equals("10");
exiting("setAttributeSchemaStartRange");
} catch (CLIException e) {
this.log(Level.SEVERE, "setAttributeSchemaStartRange", e.getMessage());
throw e;
} catch (SMSException e) {
this.log(Level.SEVERE, "setAttributeSchemaStartRange", e.getMessage());
throw e;
} catch (SSOException e) {
this.log(Level.SEVERE, "setAttributeSchemaStartRange", e.getMessage());
throw e;
}
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SchemaTest method addAttributeDefaultValues.
@Parameters({ "subschema" })
@Test(groups = { "schema", "add-attr-defs", "attribute-schema-ops", "subschema" }, dependsOnMethods = { "addAttributeSchema" })
public void addAttributeDefaultValues(String subschema) throws CLIException, SMSException, SSOException {
Object[] params = { subschema };
entering("addAttributeDefaultValues", params);
String[] args = (subschema.length() == 0) ? new String[7] : new String[9];
args[0] = "add-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=test1";
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);
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.size() == 1);
assert (values.contains("test1"));
exiting("addAttributeDefaultValues");
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class SchemaTest method setServiceI18nKey.
@Test(groups = { "schema", "set-svc-i18n-key" })
public void setServiceI18nKey() throws CLIException, SMSException, SSOException {
entering("setServiceI18nKey", null);
String[] args = { "set-svc-i18n-key", CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.SERVICE_NAME, TEST_SERVICE, CLIConstants.PREFIX_ARGUMENT_LONG + SetServiceSchemaI18nKey.ARGUMENT_I18N_KEY, "service-18nKey" };
CLIRequest req = new CLIRequest(null, args, getAdminSSOToken());
cmdManager.addToRequestQueue(req);
try {
cmdManager.serviceRequestQueue();
ServiceSchemaManager mgr = new ServiceSchemaManager(TEST_SERVICE, getAdminSSOToken());
assert mgr.getI18NKey().equals("service-18nKey");
exiting("setServiceI18nKey");
} catch (CLIException e) {
this.log(Level.SEVERE, "setServiceI18nKey", e.getMessage());
throw e;
} catch (SMSException e) {
this.log(Level.SEVERE, "setServiceI18nKey", e.getMessage());
throw e;
} catch (SSOException e) {
this.log(Level.SEVERE, "setServiceI18nKey", e.getMessage());
throw e;
}
}
Aggregations