1 23 package com.sun.enterprise.tools.verifier.tests.webservices; 24 25 import com.sun.enterprise.deployment.*; 26 import com.sun.enterprise.tools.verifier.*; 27 import java.util.*; 28 import com.sun.enterprise.tools.verifier.tests.*; 29 import java.lang.reflect.*; 30 31 34 35 47 48 public class EJBEndpointIsSLSBCheck extends WSTest implements WSCheck { 49 50 54 public Result check (WebServiceEndpoint wsdescriptor) { 55 56 Result result = getInitializedResult(); 57 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 58 59 if (wsdescriptor.implementedByEjbComponent()) { 60 EjbDescriptor ejbdesc = wsdescriptor.getEjbComponentImpl(); 61 62 if (ejbdesc == null) { 63 64 result.addErrorDetails(smh.getLocalString 65 ("tests.componentNameConstructor", 66 "For [ {0} ]", 67 new Object [] {compName.toString()})); 68 result.failed(smh.getLocalString 69 (getClass().getName() + ".failed1", 70 "Service Implementation bean Could Not be Resolved from the ejb-link specified")); 71 return result; 72 } 73 74 if (ejbdesc instanceof EjbSessionDescriptor) { 75 EjbSessionDescriptor session = (EjbSessionDescriptor)ejbdesc; 76 if (EjbSessionDescriptor.STATELESS.equals(session.getSessionType())) { 77 result.addGoodDetails(smh.getLocalString 78 ("tests.componentNameConstructor", 79 "For [ {0} ]", 80 new Object [] {compName.toString()})); 81 result.passed(smh.getLocalString 82 (getClass().getName() + ".passed", 83 "Service Implementation bean defined in ejb-jar.xml using {0} session element", new Object [] {"stateless"})); 84 } 85 else { 86 result.addErrorDetails(smh.getLocalString 88 ("tests.componentNameConstructor", 89 "For [ {0} ]", 90 new Object [] {compName.toString()})); 91 result.failed(smh.getLocalString 92 (getClass().getName() + ".failed", 93 "Service Implementation bean cannot be Stateful Session Bean")); 94 } 95 } 96 else { 97 result.addErrorDetails(smh.getLocalString 99 ("tests.componentNameConstructor", "For [ {0} ]", 100 new Object [] {compName.toString()})); 101 result.failed(smh.getLocalString 102 (getClass().getName() + ".failed2", 103 "Service Implementation bean Should be a Session Bean")); 104 } 105 106 } 107 else { 108 109 result.addNaDetails(smh.getLocalString 111 ("tests.componentNameConstructor", "For [ {0} ]", 112 new Object [] {compName.toString()})); 113 result.notApplicable(smh.getLocalString 114 (getClass().getName() + ".notapp", 115 "This is a JAX-RPC Service Endpoint")); 116 } 117 118 return result; 119 } 120 } 121 122 | Popular Tags |