FileDocCategorySizeDatePackage
WebCheckMgrImpl.javaAPI DocGlassfish v2 API8483Fri May 04 22:34:18 BST 2007com.sun.enterprise.tools.verifier.web

WebCheckMgrImpl

public class WebCheckMgrImpl extends CheckMgr implements JarCheck
Web harness

Fields Summary
private static final String
testsListFileName
name of the file containing the list of tests for the web architecture
private static final String
sunONETestsListFileName
private static TagLibDescriptor[]
tlds
Constructors Summary
public WebCheckMgrImpl(FrameworkContext frameworkContext)


       
        this.frameworkContext = frameworkContext;
    
Methods Summary
public voidcheck(com.sun.enterprise.deployment.Descriptor descriptor)
Check method introduced for WebServices integration

param
descriptor Web descriptor

        // run persistence tests first.
        checkPersistenceUnits(WebBundleDescriptor.class.cast(descriptor));
        // a WebBundleDescriptor can have an WebServicesDescriptor
        checkWebServices(descriptor);
        // a WebBundleDescriptor can have  WebService References
        checkWebServicesClient(descriptor);

        if (frameworkContext.isPartition() &&
                !frameworkContext.isWeb())
            return;

        createTaglibDescriptors(descriptor); //create document obj for all tld's defined in the war
        
        createFacesConfigDescriptor(descriptor);
        
        // run the ParseDD test
        if (getSchemaVersion(descriptor).compareTo("2.4") < 0) { // NOI18N
            WebDeploymentDescriptorFile ddf = new WebDeploymentDescriptorFile();
            File file = new File(getAbstractArchiveUri(descriptor),
                    ddf.getDeploymentDescriptorPath());
            FileInputStream is = new FileInputStream(file);
            try {
                if (is != null) {
                    Result result = new ParseDD().validateWebDescriptor(is);
                    result.setComponentName(getArchiveUri(descriptor));
                    setModuleName(result);
                    frameworkContext.getResultManager().add(result);
                    is.close();
                }
            } finally {
                try {
                    if(is!=null)
                        is.close();
                } catch(Exception e) {}
            }
        }

        super.check(descriptor);
    
protected voidcheckWebServicesClient(com.sun.enterprise.deployment.Descriptor descriptor)

        if (frameworkContext.isPartition() &&
                !frameworkContext.isWebServicesClient())
            return;

        WebBundleDescriptor desc = (WebBundleDescriptor) descriptor;
        WebServiceClientCheckMgrImpl webServiceClientCheckMgr = new WebServiceClientCheckMgrImpl(
                frameworkContext);
        if (desc.hasWebServiceClients()) {
            Set serviceRefDescriptors = desc.getServiceReferenceDescriptors();
            Iterator it = serviceRefDescriptors.iterator();

            while (it.hasNext()) {
                webServiceClientCheckMgr.setVerifierContext(context);
                webServiceClientCheckMgr.check(
                        (ServiceReferenceDescriptor) it.next());
            }
        }
    
protected voidcreateFacesConfigDescriptor(com.sun.enterprise.deployment.Descriptor descriptor)
Create FacesConfigDescriptor

param
descriptor

        FacesConfigDescriptor d = new FacesConfigDescriptor(context, (WebBundleDescriptor)descriptor);
        context.setFacesConfigDescriptor(d);
    
protected voidcreateTaglibDescriptors(com.sun.enterprise.deployment.Descriptor descriptor)
Create array of TagLibDescriptors for all the jsp tag lib files defined in the war. Set the array in the verifier Context

param
descriptor

        TagLibFactory tlf = new TagLibFactory(context, frameworkContext);
        tlds = tlf.getTagLibDescriptors((WebBundleDescriptor) descriptor);
        if (tlds != null) {
            context.setTagLibDescriptors(tlds);
            setVerifierContext(context);
        }
    
protected com.sun.enterprise.tools.verifier.tests.ComponentNameConstructorgetComponentNameConstructor(com.sun.enterprise.deployment.Descriptor descriptor)

        return new ComponentNameConstructor((WebBundleDescriptor)descriptor);
    
protected java.lang.StringgetSchemaVersion(com.sun.enterprise.deployment.Descriptor descriptor)

        return ((WebBundleDescriptor) descriptor).getSpecVersion();
    
protected java.lang.StringgetSunONETestsListFileName()

return
String filename containing the SunONE tests

        return sunONETestsListFileName;
    
protected java.util.VectorgetTestFromExcludeList()
If the call is from deployment backend and precompilejsp option is set then there is no need to run the AllJSPsMustBeCompilable test.

return
list of excluded tests
throws
ParserConfigurationException
throws
SAXException
throws
IOException

        Vector<TestInformation> tests = super.getTestFromExcludeList();
        if(frameworkContext.getJspOutDir() !=null) { // pre-compile jsp flag set
            TestInformation ti = new TestInformation();
            ti.setClassName("com.sun.enterprise.tools.verifier.tests.web.AllJSPsMustBeCompilable"); // NOI18N
            tests.addElement(ti);
        }
        return tests;
    
protected java.lang.StringgetTestsListFileName()

return the configuration file name for the list of tests pertinent to the web app space (jsp and servlet)

return
String filename containing the list of tests

        return testsListFileName;
    
protected voidsetModuleName(Result r)

        r.setModuleName(Result.WEB);