1 23 package com.sun.enterprise.tools.verifier.tests.web; 24 25 import com.sun.enterprise.deployment.*; 26 import java.io.*; 27 import com.sun.enterprise.tools.verifier.Result; 28 import com.sun.enterprise.tools.verifier.tests.*; 29 30 34 public abstract class Taglib extends WebTest { 35 36 37 41 public boolean check(WebBundleDescriptor descriptor, String taglibEntry, Result result) { 42 43 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 44 String uri = getAbstractArchiveUri(descriptor); 45 46 if (taglibEntry.startsWith("/")) 47 taglibEntry = taglibEntry.substring(1); 48 else taglibEntry = "WEB-INF/" + taglibEntry; 49 File tlf = new File(uri + File.separator + taglibEntry); 50 if (tlf.exists()) { 51 result.addGoodDetails(smh.getLocalString 52 ("tests.componentNameConstructor", 53 "For [ {0} ]", 54 new Object [] {compName.toString()})); 55 result.addGoodDetails(smh.getLocalString 56 (getClass().getName() + ".passed", 57 "Tag library/.tld file exist in web application.")); 58 return true; 59 } 60 result.addErrorDetails(smh.getLocalString 61 ("tests.componentNameConstructor", 62 "For [ {0} ]", 63 new Object [] {compName.toString()})); 64 result.addErrorDetails(smh.getLocalString 65 (getClass().getName() + ".failed", 66 "[ {0} ] is not a valid tld location.", new Object [] {taglibEntry})); 67 return false; 68 } 69 } 70 | Popular Tags |