1 17 package org.apache.geronimo.j2ee.deployment; 18 19 import junit.framework.Assert; 20 import org.apache.geronimo.common.DeploymentException; 21 import org.apache.geronimo.gbean.GBeanData; 22 import org.apache.geronimo.gbean.AbstractNameQuery; 23 import org.apache.geronimo.gbean.AbstractName; 24 import org.apache.geronimo.kernel.config.Configuration; 25 import org.apache.geronimo.kernel.config.ConfigurationStore; 26 import org.apache.geronimo.kernel.repository.Environment; 27 import org.apache.geronimo.kernel.repository.Artifact; 28 import org.apache.geronimo.kernel.Naming; 29 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; 30 import org.apache.geronimo.deployment.ModuleIDBuilder; 31 32 import javax.management.ObjectName ; 33 import javax.naming.Reference ; 34 import java.io.File ; 35 import java.net.URL ; 36 import java.util.jar.JarFile ; 37 import java.util.Collection ; 38 39 42 public class MockConnectorConfigBuilder extends Assert implements ModuleBuilder, ActivationSpecInfoLocator { 43 private EARContext earContext; 44 private ClassLoader cl; 45 public Module connectorModule; 46 47 public Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException { 48 AbstractName earName = naming.createRootName(new Artifact("test", "test-war", "", "rar"), NameFactory.NULL, NameFactory.J2EE_APPLICATION) ; 49 AbstractName moduleName = naming.createChildName(earName, "rar", NameFactory.RESOURCE_ADAPTER_MODULE); 50 return new ConnectorModule(true, moduleName, null, moduleFile, "connector", null, null, null); 51 } 52 53 public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException { 54 AbstractName moduleName = naming.createChildName(earName, "rar", NameFactory.RESOURCE_ADAPTER_MODULE); 55 return new ConnectorModule(false, moduleName, null, moduleFile, targetPath, null, null, null); 56 } 57 58 public void installModule(JarFile earFile, EARContext earContext, Module connectorModule, Collection configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) { 59 assertNotNull(earFile); 60 assertNotNull(earContext); 61 this.earContext = earContext; 62 } 70 71 public void initContext(EARContext earContext, Module connectorModule, ClassLoader cl) { 72 assertEquals(this.earContext, earContext); 73 assertNotNull(cl); 75 this.cl = cl; 76 } 77 78 public void addGBeans(EARContext earContext, Module connectorModule, ClassLoader cl, Collection repository) { 79 assertEquals(this.earContext, earContext); 80 assertEquals(this.cl, cl); 82 } 83 84 public String getSchemaNamespace() { 85 return null; 86 } 87 88 public Reference createResourceRef(AbstractNameQuery containerId, Class iface, Configuration configuration) throws DeploymentException { 89 return null; 90 } 91 92 public Reference createAdminObjectRef(AbstractNameQuery containerId, Class iface, Configuration configuration) throws DeploymentException { 93 return null; 94 } 95 96 public ObjectName locateResourceName(ObjectName query) throws DeploymentException { 97 return null; 98 } 99 100 public GBeanData locateActivationSpecInfo(AbstractNameQuery nameQuery, String messageListenerInterface, Configuration configuration) throws DeploymentException { 101 return null; 102 } 103 104 public GBeanData locateResourceAdapterGBeanData(GBeanData resourceAdapterModuleData) throws DeploymentException { 105 return null; 106 } 107 108 public GBeanData locateAdminObjectInfo(GBeanData resourceAdapterModuleData, String adminObjectInterfaceName) throws DeploymentException { 109 return null; 110 } 111 112 public GBeanData locateConnectionFactoryInfo(GBeanData resourceAdapterModuleData, String connectionFactoryInterfaceName) throws DeploymentException { 113 return null; 114 } 115 } 116 | Popular Tags |