Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
String mappingFile = descriptor.getWebService().getMappingFileUri();
if (getVerifierContext().getSchemaVersion().compareTo("1.1") > 0) {
if (mappingFile != null) {
addWarningDetails(result, compName);
result.warning(smh.getLocalString (getClass().getName() + ".warning",
"The mapping file as specified in location [ {0} ] is not required.",
new Object[] {mappingFile}));
return result;
}
} else {
InputStream deploymentEntry=null;
try {
String uri = getAbstractArchiveUri(descriptor);
try {
FileArchive arch = new FileArchive();
arch.open(uri);
deploymentEntry = arch.getEntry(mappingFile);
}catch (IOException e) { throw e;}
if (deploymentEntry == null) {
//result.fail, mapping file does not exist at that location
result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
"For [ {0} ]", new Object[] {compName.toString()}));
result.failed(smh.getLocalString (getClass().getName() + ".failed",
"The mapping file does not exist at the specified location [{0}] in the archive.",
new Object[] {mappingFile}));
}
}catch (Exception e) {
result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
"For [ {0} ]", new Object[] {compName.toString()}));
result.failed(smh.getLocalString (getClass().getName() + ".failed",
"The mapping file does not exist at the specified location [{0}] in the archive.",
new Object[] {mappingFile}));
}
finally {
try {
if (deploymentEntry != null)
deploymentEntry.close();
}catch(IOException e) {}
}
}
if(result.getStatus() != Result.FAILED || result.getStatus() != Result.WARNING) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString (getClass().getName() + ".passed",
"mapping file requirements are satisfied"));
}
return result;