1 23 package com.sun.enterprise.tools.verifier.tests.ejb; 24 25 import com.sun.enterprise.tools.verifier.apiscan.classfile.ClosureCompiler; 26 import com.sun.enterprise.tools.verifier.Result; 27 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 28 import com.sun.enterprise.tools.verifier.tests.util.ArchiveClassesLoadableHelper; 29 import com.sun.enterprise.deployment.EjbDescriptor; 30 31 39 public class EjbArchiveClassesLoadable extends EjbTest implements EjbCheck { 40 41 public Result check(EjbDescriptor descriptor) { 42 Result result = getInitializedResult(); 43 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 44 46 ClosureCompiler closureCompiler=getVerifierContext().getClosureCompiler(); 47 48 boolean allPassed = closureCompiler.buildClosure(descriptor.getEjbClassName()); 49 if (allPassed) { 50 result.setStatus(Result.PASSED); 51 addGoodDetails(result, compName); 52 result.passed(smh.getLocalString 53 (getClass().getName() + ".passed", 54 "All the classes are loadable.")); 55 } else { 56 result.setStatus(Result.FAILED); 57 addErrorDetails(result, compName); 58 result.addErrorDetails(ArchiveClassesLoadableHelper. 59 getFailedResult(closureCompiler)); 60 result.addErrorDetails(smh.getLocalString 61 ("com.sun.enterprise.tools.verifier.tests.loadableError", 62 "Please either bundle the above mentioned classes in the application " + 63 "or use optional packaging support for them.")); 64 } 65 return result; 66 } 67 } 68 | Popular Tags |