FileDocCategorySizeDatePackage
SessionConfigTest.javaAPI DocGlassfish v2 API4037Fri May 04 22:34:10 BST 2007com.sun.enterprise.tools.verifier.tests.web

SessionConfigTest

public class SessionConfigTest extends WebTest implements WebCheck

Fields Summary
Constructors Summary
Methods Summary
public com.sun.enterprise.tools.verifier.Resultcheck(com.sun.enterprise.deployment.WebBundleDescriptor descriptor)
The session-config element defines the session parameters for this web application The deployment descriptor instance file must not contain multiple elements of session-config.

param
descriptor the Web deployment descriptor
return
Result the results for this assertion

        Result result = getInitializedResult();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        //This test is not applicable for application based on Servlet Spec 2.3
        String prefix = XpathPrefixResolver.fakeXPrefix;
        String query = prefix + ":" + "web-app/" + prefix + ":" + "session-config";
        int count = getNonRuntimeCountNodeSet(query);
        
        if ( count == 0 || count == -1) {
            addNaDetails(result, compName);
            result.notApplicable(smh.getLocalString
                    (getClass().getName() + ".notApplicable",
                    "Not Applicable: Servlet session-config element is not Specified."));
        } else if ( count  == 1 ) {
            addGoodDetails(result, compName);
            result.passed(smh.getLocalString
                    (getClass().getName() + ".passed" ,
                    "The session-config element is specified correctly"));
        } else if ( count > 1 ) {
            addErrorDetails(result, compName);
            result.failed(smh.getLocalString
                    (getClass().getName() + ".failed",
                    "The deployment descriptor instance contains multiple elements of session-config element"));
        }
        return result;