1 23 24 25 package com.sun.enterprise.tools.verifier.tests.web.runtime; 26 27 import com.sun.enterprise.deployment.*; 28 import com.sun.enterprise.tools.verifier.*; 29 import com.sun.enterprise.tools.verifier.tests.*; 30 import com.sun.enterprise.deployment.WebBundleDescriptor; 31 import com.sun.enterprise.tools.verifier.tests.web.*; 32 import com.sun.enterprise.deployment.runtime.web.*; 33 34 37 39 public class ASSessionProperty extends WebTest implements WebCheck{ 40 41 42 public Result check(WebBundleDescriptor descriptor) { 43 44 45 Result result = getInitializedResult(); 46 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 47 48 boolean oneFailed = false; 49 boolean notApp = false; 50 try{ 51 SessionConfig sessionConfig = (descriptor.getSunDescriptor()).getSessionConfig(); 52 SessionProperties sessionProp=null; 53 WebProperty[] SPwebProps=null; 54 55 if(sessionConfig !=null){ 56 sessionProp = sessionConfig.getSessionProperties(); 57 if (sessionProp!=null) 58 SPwebProps=sessionProp.getWebProperty(); 59 } 60 61 if (sessionConfig!=null && sessionProp !=null && SPwebProps!=null && SPwebProps.length !=0 ) { 62 63 if(ASWebProperty.checkWebProperties(SPwebProps,result ,descriptor, this )){ 64 oneFailed=true; 65 66 addErrorDetails(result, compName); 67 result.failed(smh.getLocalString 68 (getClass().getName() + ".failed", 69 "FAILED [AS-WEB session-config] session-properties - Atleast one name/value pair is not valid in [ {0} ].", 70 new Object [] {descriptor.getName()})); 71 } 72 73 } else { 74 notApp = true; 75 } 76 77 if(notApp) { 78 addNaDetails(result, compName); 79 result.notApplicable(smh.getLocalString 80 (getClass().getName() + ".notApplicable", 81 "NOT APPLICABLE [AS-WEB session-config] session-properties element(s) not defined in the web archive [ {0} ].", 82 new Object [] {descriptor.getName()})); 83 } 84 85 if (oneFailed) { 86 result.setStatus(Result.FAILED); 87 } else if(notApp) { 88 result.setStatus(Result.NOT_APPLICABLE); 89 }else { 90 result.setStatus(Result.PASSED); 91 addGoodDetails(result, compName); 92 result.passed 93 (smh.getLocalString 94 (getClass().getName() + ".passed", 95 "PASSED [AS-WEB session-config] session-properties element(s) are valid within the web archive [ {0} ].", 96 new Object [] {descriptor.getName()} )); 97 } 98 }catch(Exception ex){ 99 oneFailed = true; 100 addErrorDetails(result, compName); 101 result.failed(smh.getLocalString 102 (getClass().getName() + ".failed1", 103 "FAILED [AS-WEB session-config] could not create the session-config object")); 104 105 } 106 return result; 107 } 108 109 } 110 111 | Popular Tags |