1 23 package com.sun.enterprise.tools.verifier.tests.ejb.elements; 24 25 import com.sun.enterprise.tools.verifier.tests.ejb.EjbTest; 26 import com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck; 27 import java.util.*; 28 import java.util.logging.Level ; 29 30 import com.sun.enterprise.deployment.*; 31 import com.sun.enterprise.tools.verifier.*; 32 import com.sun.enterprise.tools.verifier.tests.*; 33 34 35 39 public class EjbNameMethodElement extends EjbTest implements EjbCheck { 40 41 42 50 public Result check(EjbDescriptor descriptor) { 51 52 Result result = getInitializedResult(); 53 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 54 55 57 68 70 72 boolean found = false; 73 for (Iterator itr2 = 74 descriptor.getEjbBundleDescriptor().getEjbs().iterator(); 75 itr2.hasNext();) { 76 EjbDescriptor ejbDescriptor = (EjbDescriptor) itr2.next(); 77 logger.log(Level.FINE, getClass().getName() + ".debug1", 78 new Object [] {ejbDescriptor.getName()}); 79 80 83 if (descriptor.getName().equals(ejbDescriptor.getName())) { 88 found = true; 89 if (result.getStatus() != Result.FAILED){ 90 result.setStatus(Result.PASSED); 91 result.addGoodDetails(smh.getLocalString 94 ("tests.componentNameConstructor", 95 "For [ {0} ]", 96 new Object [] {compName.toString()})); 97 result.addGoodDetails 98 (smh.getLocalString 99 (getClass().getName() + ".passed", 100 "[ {0} ] is valid and contained within jar.", 101 new Object [] {descriptor.getName()})); 102 } 103 } 104 } 105 if (!found) { 106 result.addErrorDetails(smh.getLocalString 107 ("tests.componentNameConstructor", 108 "For [ {0} ]", 109 new Object [] {compName.toString()})); 110 result.addErrorDetails(smh.getLocalString 111 ("tests.componentNameConstructor", 112 "For [ {0} ]", 113 new Object [] {compName.toString()})); 114 result.failed 115 (smh.getLocalString 116 (getClass().getName() + ".failed", 117 "Error: [ {0} ] is not the name of one of the EJB's within jar.", 118 new Object [] {descriptor.getName()})); 119 } 121 return result; 123 124 } 125 126 } 127 | Popular Tags |