You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by di...@apache.org on 2004/11/08 23:17:42 UTC
svn commit: rev 56977 - in geronimo/trunk/modules/axis: . src/java/org/apache/geronimo/axis src/plans src/test/org/apache/geronimo/axis
Author: dims
Date: Mon Nov 8 14:17:40 2004
New Revision: 56977
Modified:
geronimo/trunk/modules/axis/project.xml
geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java
geronimo/trunk/modules/axis/src/plans/plan1.xml
geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java
geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimpleEJBWebServiceTest.java
geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimplePOJOWebServiceTest.java
Log:
Famous words from long along - "It does work on my machine" :)
Modified: geronimo/trunk/modules/axis/project.xml
==============================================================================
--- geronimo/trunk/modules/axis/project.xml (original)
+++ geronimo/trunk/modules/axis/project.xml Mon Nov 8 14:17:40 2004
@@ -97,6 +97,14 @@
</dependency>
<dependency>
<groupId>geronimo</groupId>
+ <artifactId>geronimo-naming-builder</artifactId>
+ <version>${pom.currentVersion}</version>
+ <properties>
+ <repository>true</repository>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>geronimo</groupId>
<artifactId>geronimo-j2ee</artifactId>
<version>${pom.currentVersion}</version>
</dependency>
Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java (original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java Mon Nov 8 14:17:40 2004
@@ -24,12 +24,8 @@
import org.apache.geronimo.gbean.WaitingException;
import org.apache.geronimo.gbean.jmx.GBeanMBean;
import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
-import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
-import org.apache.geronimo.kernel.Kernel;
import org.apache.geronimo.kernel.config.Configuration;
import org.apache.geronimo.kernel.config.ConfigurationStore;
-import org.apache.geronimo.kernel.repository.Repository;
-import org.openejb.deployment.OpenEJBModuleBuilder;
import javax.management.ObjectName;
import java.io.BufferedInputStream;
@@ -61,28 +57,13 @@
public class WSConfigBuilder implements ConfigurationBuilder {
private boolean hasEJB = false;
- private final ConfigurationStore configurationStore;
- private final ObjectName j2eeServer;
- private final ObjectName transactionContextManagerObjectName;
- private final ObjectName transactionalTimerObjectName;
- private final ObjectName nonTransactionalTimerObjectName;
- private final ObjectName trackedConnectionAssocator;
-
- public WSConfigBuilder(ObjectName j2eeServer,
- ObjectName transactionContextManagerObjectName,
- ObjectName connectionTrackerObjectName,
- ObjectName transactionalTimerObjectName,
- ObjectName nonTransactionalTimerObjectName,
- ObjectName trackedConnectionAssocator,
- Repository repository,
- Kernel kernel,
- ConfigurationStore configurationStore) {
- this.j2eeServer = j2eeServer;
- this.transactionContextManagerObjectName = transactionContextManagerObjectName;
- this.transactionalTimerObjectName = transactionalTimerObjectName;
- this.nonTransactionalTimerObjectName = nonTransactionalTimerObjectName;
- this.trackedConnectionAssocator = trackedConnectionAssocator;
- this.configurationStore = configurationStore;
+ private final EARConfigBuilder earConfigBuilder;
+ private final ConfigurationStore store;
+
+ public WSConfigBuilder(EARConfigBuilder earConfigBuilder,
+ ConfigurationStore store) {
+ this.earConfigBuilder = earConfigBuilder;
+ this.store = store;
}
public void doStart() throws WaitingException, Exception {
@@ -143,7 +124,7 @@
jos.closeEntry();
jos.close();
ArrayList list = new ArrayList(1);
- list.add(configurationStore.install(source));
+ list.add(store.install(source));
return list;
} finally {
if (sourceFile != null) {
@@ -190,33 +171,7 @@
return out;
}
- private File installEJBWebService(File module, File unpackedDir) throws IOException, URISyntaxException, DeploymentException {
- /**
- * TODO following code deploy the EJB in the OpenEJB EJB continaer.
- * The code is borrows from the geronimo openEJB module
- * modules/core/src/test/org/openejb/deployment/EJBConfigBuilderTest.java#testEJBJarDeploy()
- * Method. If this code is broken first the above test should check. If that change this will broke
- * But this can quickly fix looking at it.
- */
-
- URI defaultParentId = new URI("org/apache/geronimo/Server");
- OpenEJBModuleBuilder moduleBuilder = new OpenEJBModuleBuilder(defaultParentId, null);
- ResourceReferenceBuilder resourceReferenceBuilder = null;
- EARConfigBuilder earConfigBuilder = new EARConfigBuilder(defaultParentId,
- j2eeServer,
- transactionContextManagerObjectName,
- trackedConnectionAssocator,
- transactionalTimerObjectName,
- nonTransactionalTimerObjectName,
- null, // Repository
- moduleBuilder,
- moduleBuilder,
- null,
- null,
- resourceReferenceBuilder, // webconnector
- null, // app client
- null // kernel
- );
+ private File installEJBWebService(File module, File unpackedDir) throws IOException, DeploymentException {
JarFile jarFile = new JarFile(module);
Object plan = earConfigBuilder.getDeploymentPlan(null, jarFile);
earConfigBuilder.buildConfiguration(plan, jarFile, unpackedDir);
@@ -276,26 +231,12 @@
static {
GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(WSConfigBuilder.class);
- infoFactory.addAttribute("j2eeServer", ObjectName.class, true);
- infoFactory.addAttribute("transactionContextManagerObjectName", ObjectName.class, true);
- infoFactory.addAttribute("connectionTrackerObjectName", ObjectName.class, true);
- infoFactory.addAttribute("transactionalTimerObjectName", ObjectName.class, true);
- infoFactory.addAttribute("nonTransactionalTimerObjectName", ObjectName.class, true);
- infoFactory.addAttribute("trackedConnectionAssocator", ObjectName.class, true);
- infoFactory.addAttribute("configurationStore", ConfigurationStore.class, false);
- infoFactory.addReference("Repository", Repository.class);
- infoFactory.addAttribute("kernel", Kernel.class, false);
infoFactory.addInterface(ConfigurationBuilder.class);
+ infoFactory.addReference("EARConfigBuilder", EARConfigBuilder.class);
+ infoFactory.addReference("Store", ConfigurationStore.class);
infoFactory.setConstructor(new String[]{
- "j2eeServer",
- "transactionContextManagerObjectName",
- "connectionTrackerObjectName",
- "transactionalTimerObjectName",
- "nonTransactionalTimerObjectName",
- "trackedConnectionAssocator",
- "configurationStore",
- "Repository",
- "kernel"
+ "EARConfigBuilder",
+ "Store"
});
GBEAN_INFO = infoFactory.getBeanInfo();
}
Modified: geronimo/trunk/modules/axis/src/plans/plan1.xml
==============================================================================
--- geronimo/trunk/modules/axis/src/plans/plan1.xml (original)
+++ geronimo/trunk/modules/axis/src/plans/plan1.xml Mon Nov 8 14:17:40 2004
@@ -9,6 +9,26 @@
<version>DEV</version>
</dependency>
- <!-- Start Axis Servlet from the plan -->
- <gbean name="geronimo.server:type=WebServiceContainer,container=axis" class="org.apache.geronimo.axis.AxisGBean">
+ <!-- Use the default deployer -->
+ <gbean name="geronimo.deployer:role=Builder,type=EAR,config=org/apache/geronimo/Server" class="org.apache.geronimo.j2ee.deployment.EARConfigBuilder">
+ <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
+ <attribute name="j2eeServer" type="javax.management.ObjectName">geronimo.server:j2eeType=J2EEServer,name=geronimo</attribute>
+ <attribute name="transactionContextManagerObjectName" type="javax.management.ObjectName">geronimo.server:type=TransactionContextManager</attribute>
+ <attribute name="connectionTrackerObjectName" type="javax.management.ObjectName">geronimo.server:type=ConnectionTracker</attribute>
+ <attribute name="transactionalTimerObjectName" type="javax.management.ObjectName">geronimo.server:type=ThreadPooledTimer,name=TransactionalThreadPooledTimer</attribute>
+ <attribute name="nonTransactionalTimerObjectName" type="javax.management.ObjectName">geronimo.server:type=ThreadPooledTimer,name=NonTransactionalThreadPooledTimer</attribute>
+ <reference name="Repository">*:role=Repository,*</reference>
+ <reference name="EJBConfigBuilder">geronimo.deployer:role=ModuleBuilder,type=EJB,config=org/apache/geronimo/Server</reference>
+ <reference name="EJBReferenceBuilder">geronimo.deployer:role=ModuleBuilder,type=EJB,config=org/apache/geronimo/Server</reference>
+ <reference name="WebConfigBuilder">geronimo.deployer:role=ModuleBuilder,type=Web,config=org/apache/geronimo/Server</reference>
+ <reference name="ConnectorConfigBuilder">geronimo.deployer:role=ModuleBuilder,type=Connector,config=org/apache/geronimo/Server</reference>
+ <reference name="ResourceReferenceBuilder">geronimo.deployer:role=ModuleBuilder,type=Connector,config=org/apache/geronimo/Server</reference>
+ <reference name="AppClientConfigBuilder">geronimo.deployer:role=ModuleBuilder,type=AppClient,config=org/apache/geronimo/Server</reference>
+ </gbean>
+
+ <!-- Start Axis GBean from the plan -->
+ <gbean name="geronimo.server:type=WebServiceContainer,container=axis" class="org.apache.geronimo.axis.AxisGBean">
+ <reference name="EARConfigBuilder">geronimo.deployer:role=Builder,type=EAR,config=org/apache/geronimo/Server</reference>
+ <reference name="Store">geronimo.system:role=ConfigurationStore,type=Local</reference>
+ </gbean>
</configuration>
Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java (original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java Mon Nov 8 14:17:40 2004
@@ -20,8 +20,11 @@
import org.apache.geronimo.gbean.WaitingException;
import org.apache.geronimo.gbean.jmx.GBeanMBean;
import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.jmx.JMXUtil;
import org.apache.geronimo.system.configuration.LocalConfigStore;
import org.apache.geronimo.transaction.OnlineUserTransaction;
+import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
+import org.openejb.deployment.OpenEJBModuleBuilder;
import javax.management.ObjectName;
import java.io.File;
@@ -32,6 +35,12 @@
import java.util.Collections;
public class AbstractWebServiceTest extends AbstractTestCase {
+
+ private static final String j2eeDomainName = "openejb.server";
+ private static final String j2eeServerName = "TestOpenEJBServer";
+ private static final ObjectName transactionManagerObjectName = JMXUtil.getObjectName(j2eeDomainName + ":type=TransactionManager");
+ private static final ObjectName connectionTrackerObjectName = JMXUtil.getObjectName(j2eeDomainName + ":type=ConnectionTracker");
+
protected ObjectName axisname;
protected Kernel kernel;
protected J2EEManager j2eeManager;
@@ -85,4 +94,24 @@
AxisGeronimoUtils.delete(file);
}
+ protected EARConfigBuilder getEARConfigBuilder() throws Exception {
+ URI defaultParentId = new URI("org/apache/geronimo/Server");
+ OpenEJBModuleBuilder moduleBuilder = new OpenEJBModuleBuilder(defaultParentId, null);
+ EARConfigBuilder earConfigBuilder =
+ new EARConfigBuilder(defaultParentId,
+ new ObjectName(j2eeDomainName + ":j2eeType=J2EEServer,name=" + j2eeServerName),
+ transactionManagerObjectName,
+ connectionTrackerObjectName,
+ null,
+ null,
+ null,
+ moduleBuilder,
+ moduleBuilder,
+ null,
+ null,
+ null,
+ null,
+ null);
+ return earConfigBuilder;
+ }
}
Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimpleEJBWebServiceTest.java
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimpleEJBWebServiceTest.java (original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimpleEJBWebServiceTest.java Mon Nov 8 14:17:40 2004
@@ -15,6 +15,11 @@
*/
package org.apache.geronimo.axis;
+import org.apache.geronimo.axis.testUtils.AxisGeronimoConstants;
+import org.apache.geronimo.gbean.WaitingException;
+import org.apache.geronimo.gbean.jmx.GBeanMBean;
+
+import javax.management.ObjectName;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
@@ -25,13 +30,9 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Arrays;
-import javax.management.ObjectName;
-
-import org.apache.geronimo.axis.testUtils.AxisGeronimoConstants;
-import org.apache.geronimo.gbean.WaitingException;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
public class SimpleEJBWebServiceTest extends AbstractWebServiceTest {
+
public SimpleEJBWebServiceTest(String testName) throws FileNotFoundException, WaitingException, IOException {
super(testName);
}
@@ -46,16 +47,7 @@
kernel.loadGBean(axisname, axisgbean);
kernel.startGBean(axisname);
File jarfile = new File(getTestFile("target/generated/samples/echo-jar/echo-ewsimpl.jar"));
- WSConfigBuilder wsconfBuilder
- = new WSConfigBuilder(AxisGeronimoConstants.J2EE_SERVER_NAME,
- AxisGeronimoConstants.TRANSACTION_CONTEXT_MANAGER_NAME,
- AxisGeronimoConstants.CONNECTION_TRACKER_NAME,
- AxisGeronimoConstants.TRANSACTIONAL_TIMER_NAME,
- AxisGeronimoConstants.NONTRANSACTIONAL_TIMER_NAME,
- AxisGeronimoConstants.TRACKED_CONNECTION_ASSOCIATOR_NAME,
- null,
- kernel,
- store);
+ WSConfigBuilder wsconfBuilder = new WSConfigBuilder(getEARConfigBuilder(), store);
File out = new File("target/temp");
out.mkdirs();
File ws = wsconfBuilder.installWebService(jarfile, out, Thread.currentThread().getContextClassLoader());
@@ -67,7 +59,7 @@
//let us try to brows the WSDL of the service
- URL wsdlrequestUrl =AxisGeronimoUtils.getURL("/axis/services/echoPort?wsdl");
+ URL wsdlrequestUrl = AxisGeronimoUtils.getURL("/axis/services/echoPort?wsdl");
//+"/axis/services/AdminService?wsdl");
HttpURLConnection connection = (HttpURLConnection) wsdlrequestUrl.openConnection();
@@ -161,8 +153,9 @@
assertEquals(val, echoStringMethod.invoke(echoPort, new Object[]{val}));
Class structClass = Class.forName("org.apache.ws.echosample.EchoStruct", true, jarclassloder);
Method echostuctMethod = echoClass.getMethod("echoStruct", new Class[]{structClass});
+ assertNotNull(echostuctMethod);
Object structval = structClass.newInstance();
-
+ assertNotNull(structval);
Thread.currentThread().setContextClassLoader(ocl);
kernel.stopGBean(axisname);
kernel.unloadGBean(axisname);
Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimplePOJOWebServiceTest.java
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimplePOJOWebServiceTest.java (original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimplePOJOWebServiceTest.java Mon Nov 8 14:17:40 2004
@@ -16,7 +16,6 @@
package org.apache.geronimo.axis;
import org.apache.axis.utils.ClassUtils;
-import org.apache.geronimo.axis.testUtils.AxisGeronimoConstants;
import org.apache.geronimo.gbean.WaitingException;
import org.apache.geronimo.gbean.jmx.GBeanMBean;
import org.apache.geronimo.kernel.config.ConfigurationManager;
@@ -35,6 +34,7 @@
import java.util.List;
public class SimplePOJOWebServiceTest extends AbstractWebServiceTest {
+
public SimplePOJOWebServiceTest(String testName) throws FileNotFoundException, WaitingException, IOException {
super(testName);
}
@@ -48,16 +48,7 @@
GBeanMBean axisgbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl);
kernel.loadGBean(axisname, axisgbean);
kernel.startGBean(axisname);
- WSConfigBuilder wsconfBuilder
- = new WSConfigBuilder(AxisGeronimoConstants.J2EE_SERVER_NAME,
- AxisGeronimoConstants.TRANSACTION_CONTEXT_MANAGER_NAME,
- AxisGeronimoConstants.CONNECTION_TRACKER_NAME,
- AxisGeronimoConstants.TRANSACTIONAL_TIMER_NAME,
- AxisGeronimoConstants.NONTRANSACTIONAL_TIMER_NAME,
- AxisGeronimoConstants.TRACKED_CONNECTION_ASSOCIATOR_NAME,
- null,
- kernel,
- store);
+ WSConfigBuilder wsconfBuilder = new WSConfigBuilder(getEARConfigBuilder(), store);
List uri = wsconfBuilder.buildConfiguration(null, jarfile, outFile);
GBeanMBean config = store.getConfiguration((URI) uri.get(0));
ConfigurationManager configurationManager = kernel.getConfigurationManager();
@@ -87,7 +78,9 @@
assertEquals(val, echoStringMethod.invoke(echoPort, new Object[]{val}));
Class structClass = ClassUtils.forName("org.apache.ws.echosample.EchoStruct");
Method echostuctMethod = echoClass.getMethod("echoStruct", new Class[]{structClass});
+ assertNotNull(echostuctMethod);
Object structval = structClass.newInstance();
+ assertNotNull(structval);
kernel.stopGBean(axisname);
kernel.unloadGBean(axisname);
}