/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: SchemaTest.java,v 1.6 2008/06/25 05:44:19 qcheng Exp $
*
*/
/**
* Portions Copyrighted 2012 ForgeRock Inc
*/
public SchemaTest() {
super("CLI");
}
/**
* Create the CLIManager.
*
*/
public void suiteSetup()
throws CLIException
{
"com.sun.identity.cli.AccessManager");
}
public void loadSchema()
try {
} catch (SMSException ex) {
//create the service if it does not exist
try {
assert serviceExists(TEST_SERVICE);
exiting("loadSchema");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
}
try {
assert !serviceExists(TEST_SERVICE);
} catch (Exception e) {
throw e;
} finally {
exiting("deleteService");
}
}
public void loadMultipleServices()
try {
"TestService1", getAdminSSOToken());
assert serviceExists("TestService1");
assert serviceExists("TestService2");
assert serviceExists("TestService3");
exiting("loadMultipleServices");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
dependsOnMethods = {"loadMultipleServices"}
)
try {
assert !serviceExists("TestService1");
assert !serviceExists("TestService2");
assert !serviceExists("TestService3");
} catch (Exception e) {
throw e;
} finally {
exiting("deleteMultipleServices");
}
}
public void setInheritance()
"global",
"subschema-inheritance",
"multiple"
};
try {
"subschema-inheritance");
assert ss.supportsMultipleConfigurations();
exiting("setInheritance");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
public void createSubConfiguration()
"subschemaX",
"testConfig",
"attr1=1",
"attr2=2",
};
try {
exiting("createSubConfiguration");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
dependsOnMethods = {"setSubConfiguration"})
public void deleteSubConfiguration()
"/testConfig"
};
try {
exiting("deleteSubConfiguration");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
dependsOnMethods = {"createSubConfiguration"})
public void setSubConfiguration()
"set",
"/testConfig",
"attr1=2",
};
try {
exiting("setSubConfiguration");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
public void addPluginInterface()
"123",
"testPlugIn",
"com.sun.identity.cli.schema.DummyInterface"};
try {
exiting("addPluginInterface");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
throws SMSException, SSOException {
return sc.getAttributes();
}
public void setServiceI18nKey()
"service-18nKey"
};
try {
exiting("setServiceI18nKey");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
public void setServiceViewBeanURL()
"mockviewbeanURL"
};
try {
exiting("setServiceViewBeanURL");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
private void updateService()
};
try {
assert serviceExists(TEST_SERVICE);
exiting("updateService");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
public void addSubSchema()
"global",
MOCK_DIR + "/subschema.xml"
};
try {
assert (s != null);
exiting("addSubSchema");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
dependsOnMethods = {"addSubSchema"})
public void removeSubSchema()
"global",
"subschema"
};
try {
assert (s == null);
exiting("removeSubSchema");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
public void setGetServiceRevisionNumber()
"20"
};
};
try {
exiting("setGetServiceRevisionNumber");
} catch (CLIException e) {
e.getMessage());
throw e;
}
}
@Parameters({"subschema"})
}
try {
}
exiting("addAttributeSchema");
} catch (CLIException e) {
params);
throw e;
} catch (SMSException e) {
params);
throw e;
} catch (SSOException e) {
params);
throw e;
}
}
@Parameters({"subschema"})
"subschema"},
dependsOnMethods = {"addAttributeSchema"}
)
}
}
exiting("addAttributeDefaultValues");
}
@Parameters({"subschema"})
"subschema"},
dependsOnMethods = {"showAttributeDefaultValues"}
)
}
}
exiting("deleteAttributeDefaultValues");
}
@Parameters({"subschema"})
"subschema"},
dependsOnMethods = {"deleteAttributeDefaultValues"}
)
}
//as.addChoiceValue("testy", "testy");
//args[7] = "mock-add=testy";
}
}
//assert (defaultValues.contains("testy"));
exiting("setAttributeDefaults");
}
@Parameters({"subschema"})
"attribute-schema-ops", "subschema"},
dependsOnMethods = {"addAttributeSchema"}
)
}
try {
}
exiting("setAttributeViewBeanURL");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
@Parameters({"subschema"})
"subschema"},
dependsOnMethods = {"addAttributeSchema"}
)
}
try {
}
exiting("setAttributeAny");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
@Parameters({"subschema"})
"subschema"},
dependsOnMethods = {"addAttributeSchema"}
)
}
try {
}
exiting("setAttributeI18nKey");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
@Parameters({"subschema"})
"subschema"},
)
}
try {
}
exiting("setAttributeSchemaType");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
@Parameters({"subschema"})
"subschema"},
)
}
try {
}
exiting("setAttributeSchemaSyntax");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
@Parameters({"subschema"})
"subschema"},
)
}
try {
}
exiting("setAttributeSchemaUIType");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
@Parameters({"subschema"})
}
try {
}
exiting("setAttributeSchemaStartRange");
} catch (CLIException e) {
e.getMessage());
throw e;
} catch (SMSException e) {
e.getMessage());
throw e;
} catch (SSOException e) {
e.getMessage());
throw e;
}
}
@Parameters({"subschema"})
}
try {
}
"mock-number");
exiting("setAttributeSchemaEndRange");
} catch (CLIException e) {
e.getMessage());
throw e;
} catch (SMSException e) {
e.getMessage());
throw e;
} catch (SSOException e) {
e.getMessage());
throw e;
}
}
@Parameters({"subschema"})
"attribute-schema-ops", "subschema"})
}
try {
}
/*
* unable to verify because AttributeSchema does not have
* getValidator method. Hence pass if there are no exceptions.
*/
exiting("setAttributeSchemaValidator");
} catch (CLIException e) {
e.getMessage());
throw e;
} catch (SMSException e) {
e.getMessage());
throw e;
} catch (SSOException e) {
e.getMessage());
throw e;
}
}
@Parameters({"subschema"})
"attribute-schema-ops", "subschema"})
}
try {
}
"mock-single-choice");
exiting("setAttributeSchemaChoiceValues");
} catch (CLIException e) {
e.getMessage());
throw e;
} catch (SMSException e) {
e.getMessage());
throw e;
} catch (SSOException e) {
e.getMessage());
throw e;
}
}
@Parameters({"subschema"})
"attribute-schema-ops", "subschema"},
dependsOnMethods = {"setAttributeSchemaChoiceValues"})
}
try {
}
"mock-single-choice");
exiting("removeAttributeSchemaChoiceValues");
} catch (CLIException e) {
e.getMessage());
throw e;
} catch (SMSException e) {
e.getMessage());
throw e;
} catch (SSOException e) {
e.getMessage());
throw e;
}
}
@Parameters({"subschema"})
}
try {
}
"mock-boolean");
exiting("setAttributeSchemaBooleanValues");
} catch (CLIException e) {
e.getMessage());
throw e;
} catch (SMSException e) {
e.getMessage());
throw e;
} catch (SSOException e) {
e.getMessage());
throw e;
}
}
@Parameters({"subschema"})
dependsOnGroups = {"attribute-schema-ops"}
)
}
try {
}
exiting("deleteAttributeSchema");
} catch (CLIException e) {
throw e;
} catch (SMSException e) {
throw e;
} catch (SSOException e) {
throw e;
}
}
@Parameters({"subschema"})
"attribute-schema-ops", "subschema"},
dependsOnMethods = {"addAttributeDefaultValues"}
)
throws CLIException {
}
try {
} catch (CLIException e) {
throw e;
}
}
@Parameters({"subschema"})
"attribute-schema-ops", "subschema"},
dependsOnMethods = {"showAttributeDefaultValues"}
)
}
try {
}
exiting("removeAttributeDefaultValues");
} catch (CLIException e) {
e.getMessage());
throw e;
} catch (SMSException e) {
e.getMessage());
throw e;
} catch (SSOException e) {
e.getMessage());
throw e;
}
}
throws CLIException {
int cnt = 2;
}
}
int cnt = 2;
}
}
try {
return true;
} catch (ServiceNotFoundException snfe) {
return false;
}
}
}