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 37 public class URLPatternErrorCheck extends URLPattern { 38 39 protected void checkUrlPatternAndSetResult(String urlPattern, Descriptor descriptor, Result result, ComponentNameConstructor compName){ 40 if (urlPattern != null && 41 (urlPattern.startsWith("/") || (urlPattern.startsWith("*.") && urlPattern.length()!=2))){ 42 result.passed(smh.getLocalString 43 ("tests.componentNameConstructor", 44 "For [ {0} ]", 45 new Object [] {compName.toString()})); 46 result.addGoodDetails (smh.getLocalString 47 (getClass().getName() + ".passed", 48 "url-pattern [ {0} ] within [ {1} ] follows the rules specified in servlet specification", 49 new Object [] {urlPattern, descriptor.getName()})); 50 } else { 51 oneFailed=true; 52 result.failed(smh.getLocalString 53 ("tests.componentNameConstructor", 54 "For [ {0} ]", 55 new Object [] {compName.toString()})); 56 result.addErrorDetails (smh.getLocalString 57 (getClass().getName() + ".failed", 58 "Error: Content of the url-pattern element [ {0} ] does not follow the rules specified in servlet specification within [ {1} ]", 59 new Object [] {urlPattern, descriptor.getName()})); 60 } 61 } 62 } 63 | Popular Tags |