1 23 24 25 package com.sun.enterprise.tools.verifier.tests.web.runtime; 26 27 import com.sun.enterprise.tools.verifier.tests.web.WebTest; 28 import com.sun.enterprise.tools.verifier.tests.web.WebCheck; 29 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 30 import com.sun.enterprise.tools.verifier.Result; 31 import com.sun.enterprise.deployment.WebBundleDescriptor; 32 33 37 38 public class ASMessageDestination extends WebTest implements WebCheck { 39 40 public Result check(WebBundleDescriptor descriptor) { 41 42 Result result = getInitializedResult(); 43 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 44 45 String messageDestinationName=null; 46 String jndiName=null; 47 int count = 0; 48 try{ 49 count = getCountNodeSet("sun-web-app/message-destination"); 50 if (count>0){ 51 for(int i=0;i<count;i++){ 52 messageDestinationName = getXPathValue("sun-web-app/message-destination/message-destination-name"); 53 jndiName = getXPathValue("sun-web-app/message-destination/jndi-name"); 54 55 if(messageDestinationName==null || messageDestinationName.length()==0){ 56 result.addErrorDetails(smh.getLocalString 57 ("tests.componentNameConstructor", 58 "For [ {0} ]", 59 new Object [] {compName.toString()})); 60 result.failed(smh.getLocalString 61 (getClass().getName() + ".failed1", 62 "FAILED [AS-WEB message-destination] : message-destination-name cannot be an empty string", 63 new Object [] {descriptor.getName()})); 64 }else{ 65 result.addGoodDetails(smh.getLocalString 66 ("tests.componentNameConstructor", 67 "For [ {0} ]", 68 new Object [] {compName.toString()})); 69 result.passed(smh.getLocalString( 70 getClass().getName() + ".passed1", 71 "PASSED [AS-WEB message-destination] : message-destination-name is {1}", 72 new Object [] {descriptor.getName(),messageDestinationName})); 73 } 74 75 if(jndiName==null || jndiName.length()==0){ 76 result.addErrorDetails(smh.getLocalString 77 ("tests.componentNameConstructor", 78 "For [ {0} ]", 79 new Object [] {compName.toString()})); 80 result.failed(smh.getLocalString 81 (getClass().getName() + ".failed2", 82 "FAILED [AS-WEB message-destination] : jndi-name cannot be an empty string", 83 new Object [] {descriptor.getName()})); 84 }else{ 85 result.addGoodDetails(smh.getLocalString 86 ("tests.componentNameConstructor", 87 "For [ {0} ]", 88 new Object [] {compName.toString()})); 89 result.passed(smh.getLocalString( 90 getClass().getName() + ".passed2", 91 "PASSED [AS-WEB message-destination] : jndi-name is {1}", 92 new Object [] {descriptor.getName(),jndiName})); 93 } 94 } 95 }else{ 96 result.addNaDetails(smh.getLocalString 97 ("tests.componentNameConstructor", 98 "For [ {0} ]", 99 new Object [] {compName.toString()})); 100 result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable", 101 "NOT APPLICABLE [AS-WEB sun-web-app] : message-destination Element not defined")); 102 } 103 104 105 }catch(Exception ex){ 106 result.failed(smh.getLocalString 107 (getClass().getName() + ".failed", 108 "FAILED [AS-WEB sun-web-app] could not create the servlet object")); 109 } 110 return result; 111 } 112 113 } | Popular Tags |