Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
String messageDestinationName=null;
String jndiName=null;
int count = 0;
try{
count = getCountNodeSet("sun-web-app/message-destination");
if (count>0){
for(int i=0;i<count;i++){
messageDestinationName = getXPathValue("sun-web-app/message-destination/message-destination-name");
jndiName = getXPathValue("sun-web-app/message-destination/jndi-name");
if(messageDestinationName==null || messageDestinationName.length()==0){
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed(smh.getLocalString
(getClass().getName() + ".failed1",
"FAILED [AS-WEB message-destination] : message-destination-name cannot be an empty string",
new Object[] {descriptor.getName()}));
}else{
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.passed(smh.getLocalString(
getClass().getName() + ".passed1",
"PASSED [AS-WEB message-destination] : message-destination-name is {1}",
new Object[] {descriptor.getName(),messageDestinationName}));
}
if(jndiName==null || jndiName.length()==0){
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed(smh.getLocalString
(getClass().getName() + ".failed2",
"FAILED [AS-WEB message-destination] : jndi-name cannot be an empty string",
new Object[] {descriptor.getName()}));
}else{
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.passed(smh.getLocalString(
getClass().getName() + ".passed2",
"PASSED [AS-WEB message-destination] : jndi-name is {1}",
new Object[] {descriptor.getName(),jndiName}));
}
}
}else{
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable",
"NOT APPLICABLE [AS-WEB sun-web-app] : message-destination Element not defined"));
}
}catch(Exception ex){
result.failed(smh.getLocalString
(getClass().getName() + ".failed",
"FAILED [AS-WEB sun-web-app] could not create the servlet object"));
}
return result;