1 23 package com.sun.enterprise.tools.verifier.tests.webservices; 24 import com.sun.enterprise.deployment.WebServiceEndpoint; 25 import com.sun.enterprise.tools.verifier.Result; 26 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 27 30 47 48 public class WSWsdlPortComponentName extends WSTest implements WSCheck { 49 50 54 public Result check (WebServiceEndpoint descriptor) { 55 56 Result result = getInitializedResult(); 57 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 58 boolean pass = true; 59 String portcomponentname = null; 60 try { 61 62 portcomponentname = descriptor.getEndpointName(); 63 if ( portcomponentname == null ) 64 pass = false; 65 if ( portcomponentname.equals("") ) 66 pass = false; 67 68 if (pass) { 69 result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor", 70 "For [ {0} ]", new Object [] {compName.toString()})); 71 result.passed(smh.getLocalString (getClass().getName() + ".passed", 72 "The webservices.xml file for [ {0} ] has the port-component-name element specified.", 73 new Object [] {compName.toString()})); 74 } 75 else { 76 result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor", 77 "For [ {0} ]", new Object [] {compName.toString()})); 78 result.failed(smh.getLocalString (getClass().getName() + ".failed", 79 "The webservices.xml file for [ {0} ] does not have the port-component-name element specified.", 80 new Object [] {compName.toString()})); 81 } 82 }catch (Exception e) { 83 result.addErrorDetails(smh.getLocalString 85 ("com.sun.enterprise.tools.verifier.tests.webservices.Error", 86 "Error: Unexpected error occurred [ {0} ]", 87 new Object [] {e.getMessage()})); 88 } 89 return result; 90 } 91 } 92 93 | Popular Tags |