You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2008/04/22 19:47:28 UTC
svn commit: r650593 - in
/ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2:
./ management/
Author: mriou
Date: Tue Apr 22 10:47:27 2008
New Revision: 650593
URL: http://svn.apache.org/viewvc?rev=650593&view=rev
Log:
ODE-271 centralize server management in base class for Axis2 mini test server.
Modified:
ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java
ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java
ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeaderTest.java
ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/XSDReferencesDeployTest.java
ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/management/DeploymentTest.java
ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java
Modified: ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java?rev=650593&r1=650592&r2=650593&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java Tue Apr 22 10:47:27 2008
@@ -9,26 +9,17 @@
import org.apache.axis2.engine.AxisServer;
import org.apache.axis2.engine.MessageReceiver;
import org.apache.ode.tools.sendsoap.cline.HttpSoapSender;
-import org.apache.ode.bpel.compiler.wsdl.WSDLFactory4BPEL;
-import org.apache.ode.bpel.compiler.wsdl.WSDLFactoryBPEL20;
-import org.apache.ode.bpel.compiler.wsdl.Definition4BPEL;
-import org.apache.ode.bpel.compiler.DefaultResourceFinder;
-import org.apache.ode.bpel.compiler.WSDLLocatorImpl;
import org.apache.ode.axis2.util.Axis2UriResolver;
import org.apache.ode.axis2.util.Axis2WSDLLocator;
import org.apache.ode.axis2.hooks.ODEAxisService;
-import org.apache.ode.axis2.hooks.ODEMessageReceiver;
import javax.servlet.ServletException;
-import javax.wsdl.xml.WSDLReader;
import javax.wsdl.WSDLException;
import javax.xml.namespace.QName;
import java.io.*;
import java.net.URL;
import java.net.URI;
-import java.net.MalformedURLException;
import java.net.URISyntaxException;
-import java.util.ArrayList;
import java.util.Iterator;
/**
@@ -38,12 +29,26 @@
protected ODEAxis2Server server;
- public void start() throws Exception {
+ public void startServer() throws Exception {
String webappPath = getClass().getClassLoader().getResource("webapp").getFile();
server = new ODEAxis2Server(webappPath);
server.start();
}
+ public void stopServer() throws AxisFault {
+ server.stop();
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ startServer();
+ }
+
+ protected void tearDown() throws Exception {
+ stopServer();
+ super.tearDown();
+ }
+
protected class ODEAxis2Server extends AxisServer {
ODEServer _ode = new ODEServer();
String webappPath;
@@ -68,8 +73,8 @@
}
public void stop() throws AxisFault {
- super.stop();
_ode.shutDown();
+ super.stop();
}
protected void deployProcess(String bundleName) {
Modified: ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java?rev=650593&r1=650592&r2=650593&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java Tue Apr 22 10:47:27 2008
@@ -1,23 +1,11 @@
package org.apache.ode.axis2;
-import org.apache.ode.tools.sendsoap.cline.HttpSoapSender;
-
-import java.net.URL;
-import java.io.FileInputStream;
-
/**
* Tests that a fault thrown by a called service can be caught and is properly
* structured so that an assign on a fault sub-element will succeed.
* @author Matthieu Riou <mr...@apache.org>
*/
public class ServiceFaultCatchTest extends Axis2TestBase {
-
- protected void setUp() throws Exception {
- start();
- }
- protected void tearDown() throws Exception {
- server.stop();
- }
public void testSimpleFaultCatch() throws Exception {
String bundleName = "TestStructuredFault";
Modified: ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeaderTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeaderTest.java?rev=650593&r1=650592&r2=650593&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeaderTest.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeaderTest.java Tue Apr 22 10:47:27 2008
@@ -1,6 +1,5 @@
package org.apache.ode.axis2;
-import org.apache.axis2.description.AxisService;
import org.apache.axis2.engine.MessageReceiver;
import org.apache.axis2.engine.AxisEngine;
import org.apache.axis2.context.MessageContext;
@@ -20,13 +19,6 @@
* @author Matthieu Riou <mr...@apache.org>
*/
public class SoapHeaderTest extends Axis2TestBase {
-
- protected void setUp() throws Exception {
- start();
- }
- protected void tearDown() throws Exception {
- server.stop();
- }
public void testSimplePassing() throws Exception {
server.deployService("TestSoapHeader", "dummy-service.wsdl",
Modified: ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/XSDReferencesDeployTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/XSDReferencesDeployTest.java?rev=650593&r1=650592&r2=650593&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/XSDReferencesDeployTest.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/XSDReferencesDeployTest.java Tue Apr 22 10:47:27 2008
@@ -5,10 +5,6 @@
*/
public class XSDReferencesDeployTest extends Axis2TestBase {
- protected void setUp() throws Exception {
- start();
- }
-
public void testSimpleFaultCatch() throws Exception {
server.deployService(DummyService.class.getCanonicalName());
// If we have a bug, this will throw an exception, no need to assert
Modified: ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/management/DeploymentTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/management/DeploymentTest.java?rev=650593&r1=650592&r2=650593&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/management/DeploymentTest.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/management/DeploymentTest.java Tue Apr 22 10:47:27 2008
@@ -19,7 +19,6 @@
package org.apache.ode.axis2.management;
-import junit.framework.TestCase;
import org.apache.axiom.om.*;
import org.apache.axiom.om.util.Base64;
import org.apache.axis2.AxisFault;
@@ -131,7 +130,7 @@
}
protected void setUp() throws Exception {
- start();
+ super.setUp();
// Create a factory
_factory = OMAbstractFactory.getOMFactory();
_client = new ServiceClientUtil();
@@ -146,7 +145,7 @@
protected void tearDown() throws Exception {
undeploy(_package);
- server.stop();
+ super.tearDown();
}
private String deploy(String packageName) throws Exception {
Modified: ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java?rev=650593&r1=650592&r2=650593&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java Tue Apr 22 10:47:27 2008
@@ -159,7 +159,7 @@
}
protected void setUp() throws Exception {
- start();
+ super.setUp();
// Create a factory
_factory = OMAbstractFactory.getOMFactory();
@@ -214,7 +214,7 @@
OMElement result = sendToPM(listRoot);
assert(result.toString().indexOf("process-info") < 0);
- server.stop();
+ super.tearDown();
}
private OMElement sendToPM(OMElement msg) throws AxisFault {