Result result = getInitializedResult();
ComponentNameConstructor compName = new ComponentNameConstructor(descriptor);
boolean oneFailed = false;
boolean notApp = false;
//<addition author="irfan@sun.com" [bug/rfe]-id="4715917" >
/*Set keys = descriptor.getEjbBundleDescriptor().getIasCmpMappingsKeys();
SunCmpMappings iasCmpMappings=null;
String forPmConfig=null;*/
SunCmpMappings iasCmpMappings = descriptor.getEjbBundleDescriptor().getIasCmpMappings();
String forPmConfig = com.sun.enterprise.deployment.EjbBundleXmlReader.IAS_CMP_MAPPING_JAR_ENTRY;
//</addition>
SunCmpMapping[] allIasCmpMapping=null;
SunCmpMapping iasCmpMapping=null;
/////test vars
String schema=null;
//<addition author="irfan@sun.com" [bug/rfe]-id="4715917" >
if(iasCmpMappings != null)
{
/*if(keys!=null && keys.size()>0)
{
Iterator it = keys.iterator();
while(it.hasNext()) {
forPmConfig=(String) it.next();
iasCmpMappings= descriptor.getEjbBundleDescriptor().getIasCmpMappings(forPmConfig);*/
//</addition>
allIasCmpMapping=iasCmpMappings.getSunCmpMapping();
for(int rep=0;rep<allIasCmpMapping.length;rep++){
iasCmpMapping=allIasCmpMapping[rep];
//test logic
schema=iasCmpMapping.getSchema();
if(validateSchema(schema)){
result.passed(smh.getLocalString(getClass().getName()+".passed",
"PASSED [AS-CMP-MAPPING] : schema [{0} ] is a valid entry, in the mapping file [ {1}], "+
"of the ejb archive [ {2} ]. ",
new Object[]{schema,forPmConfig,descriptor.getName()}));
}else{
oneFailed = true;
result.failed(smh.getLocalString(getClass().getName()+".failed",
"FAILED [AS-CMP-MAPPING] : schema [{0} ] is NOT a valid entry, in the mapping file [ {1}], "+
"of the ejb archive [ {2} ]. "+
"Either null or empty.",
new Object[]{schema,forPmConfig,descriptor.getName()}));
}
}
//} 4715917 irfan
}
else
{
notApp = true;
result.notApplicable(smh.getLocalString
(getClass().getName() + ".notApplicable",
"NOT APPLICABLE [AS-CMP-MAPPING] : There is no ias-cmp-mappings file present, within the ejb 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;