Param value should not be empty string
Set contextParameters;
Iterator itr;
String epValue;
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
EnvironmentProperty ep;
boolean passed = true;
boolean oneFailed = false;
boolean notApp = false;
if (!descriptor.getContextParametersSet().isEmpty()) {
// get the context parameters
contextParameters = descriptor.getContextParametersSet();
itr = contextParameters.iterator();
// test the environment property
while (itr.hasNext()) {
ep = (EnvironmentProperty)itr.next();
epValue = ep.getValue();
if ( epValue.length() != 0) {
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addGoodDetails(smh.getLocalString
(getClass().getName() + ".passed",
"Param named/value exists for in the web archive [ {0} ].",
new Object[] {descriptor.getName()}));
} else {
oneFailed = true;
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".failed",
"Error: Param name/value should not be empty strings"));
}
}
} else {
notApp = true;
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
(getClass().getName() + ".notApplicable",
"There are no context parameters within the web archive [ {0} ]",
new Object[] {descriptor.getName()}));
}
if (oneFailed) {
result.setStatus(Result.FAILED);
} else if (notApp) {
result.setStatus(Result.NOT_APPLICABLE);
} else {
result.setStatus(Result.PASSED);
}
return result;