1 23 package com.sun.enterprise.tools.verifier.tests.web; 24 25 import java.util.*; 26 import com.sun.enterprise.deployment.*; 27 import com.sun.enterprise.tools.verifier.*; 28 import com.sun.enterprise.tools.verifier.tests.*; 29 30 31 35 public class TaglibLocation extends Taglib implements WebCheck { 36 37 38 45 public Result check(WebBundleDescriptor descriptor) { 46 47 Result result = getInitializedResult(); 48 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 49 boolean passed = true; 50 TagLibConfigurationDescriptor taglibDescriptor; 51 String taglibLocation; 52 Enumeration taglibConfig = (new Vector()).elements(); 53 if (descriptor.getJspConfigDescriptor() != null) { 54 taglibConfig = descriptor.getJspConfigDescriptor().getTagLibs(); 55 } 56 57 if (taglibConfig.hasMoreElements()){ 58 while (taglibConfig.hasMoreElements()) { 59 taglibDescriptor = (TagLibConfigurationDescriptor) taglibConfig.nextElement(); 61 taglibLocation = taglibDescriptor.getTagLibLocation(); 62 if(passed == false) 63 check(descriptor, taglibLocation, result); 64 else 65 passed = check(descriptor, taglibLocation, result); 66 } 67 } else { 68 result.addNaDetails(smh.getLocalString 69 ("tests.componentNameConstructor", 70 "For [ {0} ]", 71 new Object [] {compName.toString()})); 72 result.notApplicable(smh.getLocalString 73 (getClass().getName() + ".notApplicable", 74 "There are no TagLibConfigurationDescriptors within the web archive [ {0} ]", 75 new Object [] {descriptor.getName()})); 76 result.setStatus(Result.NOT_APPLICABLE); 77 return result; 78 79 } 80 81 if ( passed) { 82 result.setStatus(Result.PASSED); 83 } else { 84 result.setStatus(Result.FAILED); 85 } 86 87 return result; 88 } 89 } 90 | Popular Tags |