1 23 package com.sun.enterprise.tools.verifier.tests.webservices; 24 import javax.xml.namespace.QName ; 25 import com.sun.enterprise.deployment.WebServiceEndpoint; 26 import com.sun.enterprise.tools.verifier.Result; 27 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 28 31 32 53 54 public class WSWsdlPort extends WSTest implements WSCheck { 55 59 public Result check (WebServiceEndpoint descriptor) { 60 61 Result result = getInitializedResult(); 62 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 63 boolean pass = true; 64 try { 65 66 javax.xml.namespace.QName wsdlport = descriptor.getWsdlPort(); 67 if ( wsdlport != null) { 69 String localpart = wsdlport.getLocalPart(); 71 73 if ( localpart == null || localpart.equals("") ) { 74 pass = false; 76 } 77 78 82 } else { 83 pass = false; 85 } 86 87 if (pass) { 88 result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor", 89 "For [ {0} ]", new Object [] {compName.toString()})); 90 result.passed(smh.getLocalString (getClass().getName() + ".passed", 91 "The wsdl-port in the webservices.xml file for [{0}] is specified for the endpoint", 92 new Object [] {compName.toString()})); 93 } 94 else { 95 result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor", 96 "For [ {0} ]", new Object [] {compName.toString()})); 97 result.failed(smh.getLocalString (getClass().getName() + ".failed", 98 "The wsdl-port in the webservices.xml file for [{0}] is not correctly specified for the endpoint", 99 new Object [] {compName.toString()})); 100 } 101 }catch (Exception e) { 102 result.addErrorDetails(smh.getLocalString 104 ("com.sun.enterprise.tools.verifier.tests.webservices.Error", 105 "Error: Unexpected error occurred [ {0} ]", 106 new Object [] {e.getMessage()})); 107 } 108 return result; 109 } 110 } 111 | Popular Tags |