FileDocCategorySizeDatePackage
EjbArchiveClassesLoadable.javaAPI DocGlassfish v2 API4053Fri May 04 22:33:32 BST 2007com.sun.enterprise.tools.verifier.tests.ejb

EjbArchiveClassesLoadable

public class EjbArchiveClassesLoadable extends EjbTest implements EjbCheck
A j2ee archive should be self sufficient and should not depend on any classes to be available at runtime. The test checks whether all the classes found in the ejb archive are loadable and the classes that are referenced inside their code are also loadable within the jar.
author
Vikas Awasthi

Fields Summary
Constructors Summary
Methods Summary
public com.sun.enterprise.tools.verifier.Resultcheck(com.sun.enterprise.deployment.EjbDescriptor descriptor)

        Result result = getInitializedResult();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
//        String archiveUri = getAbstractArchiveUri(descriptor);
        
        ClosureCompiler closureCompiler=getVerifierContext().getClosureCompiler();
        
        boolean allPassed = closureCompiler.buildClosure(descriptor.getEjbClassName());
        if (allPassed) {
            result.setStatus(Result.PASSED);
            addGoodDetails(result, compName);
            result.passed(smh.getLocalString
                          (getClass().getName() + ".passed",
                           "All the classes are loadable."));
        } else {
            result.setStatus(Result.FAILED);
            addErrorDetails(result, compName);
            result.addErrorDetails(ArchiveClassesLoadableHelper.
                    getFailedResult(closureCompiler));
            result.addErrorDetails(smh.getLocalString
                    ("com.sun.enterprise.tools.verifier.tests.loadableError",
                            "Please either bundle the above mentioned classes in the application " +
                            "or use optional packaging support for them."));
        } 
        return result;