1 23 package com.sun.enterprise.tools.verifier.tests.web; 24 25 import com.sun.enterprise.tools.verifier.tests.web.WebTest; 26 import java.util.*; 27 import java.io.*; 28 import com.sun.enterprise.deployment.*; 29 import com.sun.enterprise.tools.verifier.*; 30 import com.sun.enterprise.tools.verifier.tests.*; 31 import com.sun.enterprise.util.FileClassLoader; 32 33 34 39 public class SessionTimeout extends WebTest implements WebCheck { 40 41 42 51 public Result check(WebBundleDescriptor descriptor) { 52 53 Result result = getInitializedResult(); 54 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 55 56 boolean na = false; 57 boolean foundIt = false; 58 Integer sessionTimeout = new Integer (descriptor.getSessionTimeout()); 59 if (sessionTimeout.intValue() == -1 ) { 62 na = true; 63 } else if (sessionTimeout.intValue() >= 0 ) { 64 foundIt = true; 65 } else { 66 foundIt = false; 67 } 68 69 if (na) { 71 result.addNaDetails(smh.getLocalString 72 ("tests.componentNameConstructor", 73 "For [ {0} ]", 74 new Object [] {compName.toString()})); 75 result.notApplicable(smh.getLocalString 76 (getClass().getName() + ".notApplicable", 77 "Not Applicable: Servlet session-timeout [ {0} ] element does not define the default session timeout interval.", 78 new Object [] {sessionTimeout.toString()})); 79 } else if (foundIt) { 80 result.addGoodDetails(smh.getLocalString 81 ("tests.componentNameConstructor", 82 "For [ {0} ]", 83 new Object [] {compName.toString()})); 84 result.passed(smh.getLocalString 85 (getClass().getName() + ".passed", 86 "Servlet session-timeout [ {0} ] element defines the default session timeout interval expressed in whole minutes.", 87 new Object [] {sessionTimeout.toString()})); 88 } else { 89 result.addErrorDetails(smh.getLocalString 90 ("tests.componentNameConstructor", 91 "For [ {0} ]", 92 new Object [] {compName.toString()})); 93 result.failed(smh.getLocalString 94 (getClass().getName() + ".failed", 95 "Error: Servlet session-timeout [ {0} ] element does not define the default session timeout interval expressed in whole minutes.", 96 new Object [] {sessionTimeout.toString()})); 97 } 98 return result; 99 } 100 } 101 | Popular Tags |