1 23 package com.sun.enterprise.tools.verifier.tests.wsclients; 24 25 import com.sun.enterprise.deployment.*; 26 import com.sun.enterprise.tools.verifier.*; 27 import com.sun.enterprise.tools.verifier.tests.*; 28 import java.io.IOException ; 29 import java.lang.reflect.*; 30 import java.util.*; 31 32 35 36 45 46 public class ServiceRefCheck extends WSClientTest implements WSClientCheck { 47 48 52 public Result check (ServiceReferenceDescriptor descriptor) { 53 54 Result result = getInitializedResult(); 55 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 56 boolean pass = true; 57 58 if (descriptor.hasGenericServiceInterface()) { 59 result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor", 61 "For [ {0} ]", new Object [] {compName.toString()})); 62 result.passed(smh.getLocalString (getClass().getName() + ".passed", 63 "The JAX-RPC Service interface the client depends on is the Generic Service Interface.")); 64 65 66 } 67 else if (descriptor.hasGeneratedServiceInterface()) { 68 String intf = descriptor.getServiceInterface(); 69 try { 70 Class cl = Class.forName(intf, false, getVerifierContext().getClassLoader()); 71 result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor", 73 "For [ {0} ]", new Object [] {compName.toString()})); 74 result.passed(smh.getLocalString (getClass().getName() + ".passed1", 75 "The JAX-RPC Service interface the client depends on is a Generated Service Interface [{0}].", 76 new Object [] {intf})); 77 78 }catch (ClassNotFoundException e) { 79 result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor", 81 "For [ {0} ]", new Object [] {compName.toString()})); 82 result.failed(smh.getLocalString (getClass().getName() + ".failed", 83 "The JAX-RPC Service interface the client depends on [{0}] could not be loaded.", 84 new Object [] {intf})); 85 86 pass = false; 87 } 88 } 89 else { 90 result.addErrorDetails(smh.getLocalString 92 ("com.sun.enterprise.tools.verifier.tests.webservices.Error", 93 "Error: Unexpected error occurred [ {0} ]", 94 new Object [] {"Service Interface Neither Generic nor Generated"})); 95 } 96 97 return result; 98 } 99 } 100 101 | Popular Tags |