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 41 public class URLPatternContainsCRLF extends URLPattern { 44 45 protected void checkUrlPatternAndSetResult(String urlPattern, Descriptor descriptor, Result result, ComponentNameConstructor compName){ 46 if (urlPattern == null) return; final int LF = 10, CR = 13; 49 if (urlPattern.indexOf(CR)!=-1 || urlPattern.indexOf(LF)!=-1) { 50 oneFailed=true; 51 result.failed(smh.getLocalString 52 ("tests.componentNameConstructor", 53 "For [ {0} ]", 54 new Object [] {compName.toString()})); 55 result.addErrorDetails (smh.getLocalString 56 (getClass().getName() + ".failed", 57 "url-pattern [ {0} ] within [ {1} ] contains a carriage return or line feed char", 58 new Object [] {urlPattern, descriptor.getName()})); 59 } else { 60 result.passed(smh.getLocalString 61 ("tests.componentNameConstructor", 62 "For [ {0} ]", 63 new Object [] {compName.toString()})); 64 result.addGoodDetails (smh.getLocalString 65 (getClass().getName() + ".passed", 66 "url-pattern [ {0} ] within [ {1} ] does not contain carriage return or line feed char", 67 new Object [] {urlPattern, descriptor.getName()})); 68 } 69 } 70 } 71 | Popular Tags |