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