1 23 28 29 package com.sun.enterprise.tools.verifier.tests.connector.cci; 30 31 import java.io.File ; 32 import java.lang.reflect.Method ; 33 import com.sun.enterprise.tools.verifier.Result; 34 import com.sun.enterprise.tools.verifier.Verifier; 35 import com.sun.enterprise.deployment.ConnectorDescriptor; 36 import com.sun.enterprise.tools.verifier.tests.*; 37 import com.sun.enterprise.tools.verifier.tests.connector.ConnectorCheck; 38 39 46 public class ConnectionFactoryDefaultConstructor 47 extends ConnectionFactoryTest 48 implements ConnectorCheck 49 { 50 59 public Result check(ConnectorDescriptor descriptor) { 60 61 Result result = getInitializedResult(); 62 ComponentNameConstructor compName = 63 getVerifierContext().getComponentNameConstructor(); 64 Class connFactoryImpl = null; 65 if(isCCIImplemented(descriptor, result)) 66 { 67 connFactoryImpl = testConnectionFactoryImpl(descriptor, result); 68 if (connFactoryImpl == null) 69 return result; 70 } 71 else 72 { 73 result.addNaDetails(smh.getLocalString 75 ("tests.componentNameConstructor", 76 "For [ {0} ]", 77 new Object [] {compName.toString()})); 78 result.notApplicable(smh.getLocalString 79 ("com.sun.enterprise.tools.verifier.tests.connector.cci.notApp", 80 "The CCI interfaces do not seem to be implemented by this resource adapter")); 81 return result; 82 } 83 try 85 { 86 connFactoryImpl.getConstructor(new Class [0]); 87 result.addGoodDetails(smh.getLocalString 88 ("tests.componentNameConstructor", 89 "For [ {0} ]", 90 new Object [] {compName.toString()})); 91 result.passed(smh.getLocalString 92 ("com.sun.enterprise.tools.verifier.tests.connector.cci.ConnectionFactoryDefaultConstructor.defConstr", 93 "The connectionfactory-impl-class: [ {0} ] provides a default constructor.", new Object [] {connFactoryImpl.getName()} )); 94 } 95 catch(NoSuchMethodException nsme) 96 { 97 result.addErrorDetails(smh.getLocalString 98 ("tests.componentNameConstructor", 99 "For [ {0} ]", 100 new Object [] {compName.toString()})); 101 result.failed(smh.getLocalString 102 ("com.sun.enterprise.tools.verifier.tests.connector.cci.ConnectionFactoryDefaultConstructor.noDefConstr", 103 "Error: The connectionfactory-impl-class: [ {0} ] must provide a default constructor.", new Object [] {connFactoryImpl.getName()} )); 104 } 105 catch(SecurityException se) 106 { 107 } 108 return result; 109 } 110 } 111 | Popular Tags |