FileDocCategorySizeDatePackage
DefaultConnectionManagerSerializable.javaAPI DocGlassfish v2 API4819Fri May 04 22:33:28 BST 2007com.sun.enterprise.tools.verifier.tests.connector

DefaultConnectionManagerSerializable

public class DefaultConnectionManagerSerializable extends ConnectorTest implements ConnectorCheck
Test if the default implementation of the javax.resource.spi.ConnectionManager provided implements the java.io.Serializable interface
author
Jerome Dochez
version

Fields Summary
Constructors Summary
Methods Summary
public com.sun.enterprise.tools.verifier.Resultcheck(com.sun.enterprise.deployment.ConnectorDescriptor descriptor)

Test if the default implementation of the javax.resource.spi.ConnectionManager provided implements the java.io.Serializable interface

paramm
descriptor deployment descriptor for the rar file
return
result object containing the result of the individual test performed

        
        Result result = getInitializedResult();
	ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        if(!descriptor.getOutBoundDefined())
        {
          result.addNaDetails(smh.getLocalString
              ("tests.componentNameConstructor",
               "For [ {0} ]",
               new Object[] {compName.toString()}));
          result.notApplicable(smh.getLocalString
              ("com.sun.enterprise.tools.verifier.tests.connector.managed.notApplicableForInboundRA",
               "Resource Adapter does not provide outbound communication"));
          return result;
        }
        
        // let's get first the the default implementation of the ConnectionManager
        //File jarFile = Verifier.getJarFile(descriptor.getModuleDescriptor().getArchiveUri());
//        File f=Verifier.getArchiveFile(descriptor.getModuleDescriptor().getArchiveUri());
        Class c = findImplementorOf(descriptor, "javax.resource.spi.ConnectionManager");
        
        if (c!=null) {
            // We found it, let's see if it implements the right interface
            testImplementationOf(c, "java.io.Serializable", result);
            return result;
        }
        // ooppss, no implementation of the default Connection Manager
        result.addErrorDetails(smh.getLocalString
			       ("tests.componentNameConstructor",
				"For [ {0} ]",
				new Object[] {compName.toString()}));
	result.failed(smh.getLocalString
		      ("com.sun.enterprise.tools.verifier.tests.connector.DefaultConnectionManagerExistence.failed", 
		       "Error: There is no default implementation of the [ {0} ] provided",
		       new Object[] {"javax.resource.spi.ConnectionManager"}));                            
        return result;