1 23 package com.sun.enterprise.tools.verifier.tests.ejb; 24 25 import com.sun.enterprise.deployment.EjbDescriptor; 26 import com.sun.enterprise.deployment.EjbEntityDescriptor; 27 import com.sun.enterprise.deployment.EjbSessionDescriptor; 28 import com.sun.enterprise.tools.verifier.Result; 29 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 30 31 32 38 public class EjbHasLocalorRemoteorBothInterfaces extends EjbTest implements EjbCheck { 39 40 48 public Result check(EjbDescriptor descriptor) { 49 50 Result result = getInitializedResult(); 51 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 52 53 if (!(descriptor instanceof EjbSessionDescriptor) && 54 !(descriptor instanceof EjbEntityDescriptor)) { 55 addNaDetails(result, compName); 56 result.notApplicable(smh.getLocalString 57 ("com.sun.enterprise.tools.verifier.tests.ejb.intf.InterfaceClassExist.notApplicable1", 58 "Test apply only to session or entity beans.")); 59 return result; 60 } 61 if ((descriptor.getRemoteClassName() == null || "".equals(descriptor.getRemoteClassName()))&& 62 (descriptor.getLocalClassName() == null || "".equals(descriptor.getLocalClassName()))) { 63 64 if (implementsEndpoints(descriptor)) { 65 addNaDetails(result, compName); 66 result.notApplicable(smh.getLocalString 67 ("com.sun.enterprise.tools.verifier.tests.ejb.webservice.notapp", 68 "Not Applicable because, EJB [ {0} ] implements a Service Endpoint Interface.", 69 new Object [] {compName.toString()})); 70 return result; 71 } 72 else { 73 addErrorDetails(result, compName); 74 result.failed(smh.getLocalString 75 (getClass().getName() + ".failed", 76 "Ejb [ {0} ] does not have local or remote interfaces", 77 new Object [] {descriptor.getEjbClassName()})); 78 return result; 79 } 80 } 81 else { 82 addGoodDetails(result, compName); 83 result.passed(smh.getLocalString 84 (getClass().getName() + ".passed", 85 "Ejb [ {0} ] does have valid local and/or remote interfaces", 86 new Object [] {descriptor.getEjbClassName()})); 87 return result; 88 } 89 } 90 } 91 92 | Popular Tags |