1 23 package com.sun.enterprise.tools.verifier.tests.app; 24 25 import com.sun.enterprise.tools.verifier.tests.app.ApplicationTest; 26 import java.util.*; 27 import com.sun.enterprise.deployment.*; 28 import com.sun.enterprise.tools.verifier.*; 29 30 35 36 public class EjbURI extends ApplicationTest implements AppCheck { 37 38 39 46 public Result check(Application descriptor) { 47 48 Result result = getInitializedResult(); 49 50 51 if (descriptor.getEjbBundleDescriptors().size() > 0) { 52 boolean oneFailed = false; 53 for (Iterator itr = descriptor.getEjbBundleDescriptors().iterator(); itr.hasNext();) { 54 EjbBundleDescriptor ejbd = (EjbBundleDescriptor) itr.next(); 55 56 57 if (ejbd.getModuleDescriptor().getArchiveUri().endsWith(".jar")) { 59 result.passed 60 (smh.getLocalString 61 (getClass().getName() + ".passed", 62 "[ {0} ] specifies the URI [ {1} ] of an ejb-jar, relative to the top level of the application package [ {2} ].", 63 new Object [] {ejbd.getName(), ejbd.getModuleDescriptor().getArchiveUri(), descriptor.getName()})); 64 } else { 65 if (!oneFailed) { 66 oneFailed =true; 67 } 68 result.addErrorDetails 69 (smh.getLocalString 70 (getClass().getName() + ".failed", 71 "Error: [ {0} ] does not specify the URI [ {1} ] of an ejb-jar, relative to the top level of the application package [ {2} ], or does not end with \".jar\"", 72 new Object [] {ejbd.getName(), ejbd.getModuleDescriptor().getArchiveUri(), descriptor.getName()})); 73 } 74 } 75 if (oneFailed) { 76 result.setStatus(Result.FAILED); 77 } else { 78 result.setStatus(Result.PASSED); 79 } 80 } else { 81 result.notApplicable(smh.getLocalString 82 (getClass().getName() + ".notApplicable", 83 "There are no ejb components in application [ {0} ]", 84 new Object [] {descriptor.getName()})); 85 } 86 87 return result; 88 } 89 } 90 | Popular Tags |