1 23 24 package com.sun.enterprise.tools.verifier.tests.web; 25 26 import com.sun.enterprise.deployment.WebBundleDescriptor; 27 import com.sun.enterprise.tools.verifier.Result; 28 import com.sun.enterprise.tools.verifier.XpathPrefixResolver; 29 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 30 31 32 36 public class SessionConfigTest extends WebTest implements WebCheck { 37 38 39 47 48 public Result check(WebBundleDescriptor descriptor) { 49 Result result = getInitializedResult(); 50 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 51 String prefix = XpathPrefixResolver.fakeXPrefix; 53 String query = prefix + ":" + "web-app/" + prefix + ":" + "session-config"; 54 int count = getNonRuntimeCountNodeSet(query); 55 56 if ( count == 0 || count == -1) { 57 addNaDetails(result, compName); 58 result.notApplicable(smh.getLocalString 59 (getClass().getName() + ".notApplicable", 60 "Not Applicable: Servlet session-config element is not Specified.")); 61 } else if ( count == 1 ) { 62 addGoodDetails(result, compName); 63 result.passed(smh.getLocalString 64 (getClass().getName() + ".passed" , 65 "The session-config element is specified correctly")); 66 } else if ( count > 1 ) { 67 addErrorDetails(result, compName); 68 result.failed(smh.getLocalString 69 (getClass().getName() + ".failed", 70 "The deployment descriptor instance contains multiple elements of session-config element")); 71 } 72 return result; 73 } 74 } 75 | Popular Tags |