1 23 package com.sun.enterprise.tools.verifier.tests.webservices; 24 25 import com.sun.enterprise.deployment.*; 26 import com.sun.enterprise.deployment.deploy.shared.FileArchive; 27 import com.sun.enterprise.tools.verifier.*; 28 import com.sun.enterprise.tools.verifier.tests.*; 29 import java.io.*; 30 31 34 35 49 50 public class WSDLFileCheck extends WSTest implements WSCheck { 51 52 56 public Result check (WebServiceEndpoint descriptor) { 57 58 Result result = getInitializedResult(); 59 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 60 61 63 InputStream deploymentEntry=null; 67 68 String wsdlUri = descriptor.getWebService().getWsdlFileUri(); 70 71 try { 72 String uri = getAbstractArchiveUri(descriptor); 74 FileArchive arch = new FileArchive(); 76 arch.open(uri); 77 deploymentEntry = arch.getEntry(wsdlUri); 78 if (deploymentEntry == null) { 88 result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor", 90 "For [ {0} ]", new Object [] {compName.toString()})); 91 result.failed(smh.getLocalString (getClass().getName() + ".failed", 92 "WSDL file does not exist in the archive at uri [{0}].", 93 new Object [] {wsdlUri})); 94 95 } 97 else { 98 result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor", 100 "For [ {0} ]", new Object [] {compName.toString()})); 101 result.passed(smh.getLocalString (getClass().getName() + ".passed", 102 "WSDL file exists in the archive at uri [{0}].", 103 new Object [] {wsdlUri})); 104 105 } 106 }catch (Exception e) { 107 result.addErrorDetails(smh.getLocalString 109 ("com.sun.enterprise.tools.verifier.tests.webservices.Error", 110 "Error: Unexpected error occurred [ {0} ]", 111 new Object [] {e.getMessage()})); 112 } 114 finally { 115 try { 116 if (deploymentEntry != null) 117 deploymentEntry.close(); 118 }catch(IOException e) {} 119 } 120 121 return result; 122 } 123 } 124 125 | Popular Tags |