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 com.sun.enterprise.deployment.*; 28 import com.sun.enterprise.tools.verifier.*; 29 import com.sun.enterprise.tools.verifier.tests.*; 30 31 36 public class URLPatternWarningCheck extends URLPattern { 37 38 protected void checkUrlPatternAndSetResult(String urlPattern, Descriptor descriptor, Result result, ComponentNameConstructor compName){ 39 40 if(urlPattern==null) return; 42 int count = new StringTokenizer(urlPattern,"*", true).countTokens(); 43 if((count ==2 && !urlPattern.endsWith("/*") && !urlPattern.startsWith("*.")) || (count > 2)) { 47 oneWarning=true; 48 result.warning(smh.getLocalString 49 ("tests.componentNameConstructor", 50 "For [ {0} ]", 51 new Object [] {compName.toString()})); 52 result.addWarningDetails (smh.getLocalString 53 (getClass().getName() + ".warning", 54 "url-pattern [ {0} ] within [ {1} ] will be used for exact match only, although it contains a *", 55 new Object [] {urlPattern, descriptor.getName()})); 56 } else { 57 result.passed(smh.getLocalString 58 ("tests.componentNameConstructor", 59 "For [ {0} ]", 60 new Object [] {compName.toString()})); 61 result.addGoodDetails (smh.getLocalString 62 (getClass().getName() + ".passed", 63 "url-pattern [ {0} ] within [ {1} ] follows the rules specified in servlet spec", 64 new Object [] {urlPattern, descriptor.getName()})); 65 } 66 } 67 } 68 | Popular Tags |