1 23 package com.sun.enterprise.tools.verifier.tests.ejb.ejb30; 24 25 import com.sun.enterprise.tools.verifier.tests.ejb.EjbTest; 26 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 27 import com.sun.enterprise.tools.verifier.Result; 28 import com.sun.enterprise.deployment.EjbDescriptor; 29 30 import java.util.Set ; 31 32 38 public class ValidBusinessInterface extends EjbTest { 39 40 public Result check(EjbDescriptor descriptor) { 41 Result result = getInitializedResult(); 42 ComponentNameConstructor compName = 43 getVerifierContext().getComponentNameConstructor(); 44 Set <String > remoteAndLocalIntfs = descriptor.getRemoteBusinessClassNames(); 45 remoteAndLocalIntfs.addAll(descriptor.getLocalBusinessClassNames()); 46 47 for (String remoteOrLocalIntf : remoteAndLocalIntfs) { 48 try { 49 ClassLoader classLoader = getVerifierContext().getClassLoader(); 50 Class c = Class.forName(remoteOrLocalIntf, false, classLoader); 51 if(!c.isInterface()) { 52 addErrorDetails(result, compName); 53 result.failed(smh.getLocalString 54 (getClass().getName() + ".failed", 55 "[ {0} ] is defined as a class. It should be an interface.", 56 new Object [] {c})); 57 } 58 } catch (ClassNotFoundException e) { 59 } 61 } 62 63 if(result.getStatus() != Result.FAILED) { 64 addGoodDetails(result, compName); 65 result.passed(smh.getLocalString 66 (getClass().getName() + ".passed", 67 "Business Interface(s) are valid.")); 68 } 69 70 return result; 71 } 72 } 73 | Popular Tags |