You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ch...@apache.org on 2006/04/26 06:51:11 UTC
svn commit: r397088 - in /webservices/sandesha/trunk: ./ test-resources/
test/src/org/apache/sandesha2/ test/src/org/apache/sandesha2/scenarios/
test/src/org/apache/sandesha2/versions/
Author: chamikara
Date: Tue Apr 25 21:51:08 2006
New Revision: 397088
URL: http://svn.apache.org/viewcvs?rev=397088&view=rev
Log:
Corrected the 'mar' target to copy the generated mar to the maven repo.
Overrided the default dist target which was failing.
Changed test cases to get the port for the dynamic server from a property file. Users can change the test port, if it is used by some other program.
Added:
webservices/sandesha/trunk/test-resources/sandesha2-test.properties
Modified:
webservices/sandesha/trunk/maven.xml
webservices/sandesha/trunk/test/src/org/apache/sandesha2/MessageRetransmissionTest.java
webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaClientTest.java
webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaReportsTest.java
webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaTestCase.java
webservices/sandesha/trunk/test/src/org/apache/sandesha2/SquenceOfferTest.java
webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AddressableEchoTest.java
webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AddressablePingTest.java
webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AnonymousAckEchoTest.java
webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AnonymousPingTest.java
webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/AddressingVersionTest.java
webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/RMVersionTest.java
webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/SOAPVersionTest.java
Modified: webservices/sandesha/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/maven.xml?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/maven.xml (original)
+++ webservices/sandesha/trunk/maven.xml Tue Apr 25 21:51:08 2006
@@ -28,14 +28,20 @@
<ant:property name="repo.addressing.mar.path" value="${maven.repo.local}/axis2/mars" />
<ant:property name="repo.addressing.mar" value="${repo.addressing.mar.path}/${repo.addressing.mar.full.name}" />
- <goal name="build:all" prereqs="clean,mar,repo:create,jar,client:jar,sample:create" />
+ <goal name="build:all" prereqs="mar,jar,client:jar,sample:create" />
<goal name="all:jar" prereqs="mar,jar,client:jar" />
<goal name="default">
+ <attainGoal name="clean"/>
<attainGoal name="build:all"/>
</goal>
+ <!-- Befor running the tests the repo should be created-->
+ <preGoal name="test:test">
+ <attainGoal name="repo:create"/>
+ </preGoal>
+
<goal name="mar" prereqs="java:compile">
<ant:property name="metainf.path" value="${build.temp.dir}/module/META-INF" />
<ant:mkdir dir="${metainf.path}" />
@@ -49,6 +55,10 @@
</copy>
<ant:jar jarfile="${maven.build.dir}/${mar.name}" basedir="${build.temp.dir}/module" />
+
+ <copy file="${maven.build.dir}/${mar.name}"
+ tofile="${maven.repo.local}/${pom.artifactId}/mars/${mar.name}"/>
+
<delete dir="${build.temp.dir}" />
</goal>
@@ -310,5 +320,9 @@
<ant:delete file="target/${dist.name}-src.tar"/>
</goal>
+ <goal name="dist" prereqs="clean">
+ <attainGoal name="dist-bin" />
+ <attainGoal name="dist-src" />
+ </goal>
</project>
Added: webservices/sandesha/trunk/test-resources/sandesha2-test.properties
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test-resources/sandesha2-test.properties?rev=397088&view=auto
==============================================================================
--- webservices/sandesha/trunk/test-resources/sandesha2-test.properties (added)
+++ webservices/sandesha/trunk/test-resources/sandesha2-test.properties Tue Apr 25 21:51:08 2006
@@ -0,0 +1 @@
+test.server.port=8060
\ No newline at end of file
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/MessageRetransmissionTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/MessageRetransmissionTest.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/MessageRetransmissionTest.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/MessageRetransmissionTest.java Tue Apr 25 21:51:08 2006
@@ -18,8 +18,6 @@
import java.io.File;
-import junit.framework.TestCase;
-
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
@@ -33,6 +31,8 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContextConstants;
import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.client.SandeshaClient;
import org.apache.sandesha2.client.SandeshaClientConstants;
import org.apache.sandesha2.client.SequenceReport;
@@ -41,23 +41,43 @@
* @author chamikara
*
*/
-public class MessageRetransmissionTest extends TestCase {
-
+public class MessageRetransmissionTest extends SandeshaTestCase {
SimpleHTTPServer httpServer = null;
private final String applicationNamespaceName = "http://tempuri.org/";
private final String ping = "ping";
private final String Text = "Text";
+ private Log log = LogFactory.getLog(getClass());
+
+ int serverPort = DEFAULT_SERVER_TEST_PORT;
+
+ public MessageRetransmissionTest () {
+ super ("MessageRetransmissionTest");
+ }
+
+ public void setUp () {
+ String serverPortStr = getTestProperty("test.server.port");
+ if (serverPortStr!=null) {
+
+ try {
+ serverPort = Integer.parseInt(serverPortStr);
+ } catch (NumberFormatException e) {
+ log.error(e);
+ }
+ }
+ }
+
private void startServer () throws AxisFault {
String repoPath = "target" + File.separator + "repos" + File.separator + "server";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
+
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
- httpServer = new SimpleHTTPServer (configContext,8060);
+ httpServer = new SimpleHTTPServer (configContext,serverPort);
httpServer.start();
try {
Thread.sleep(300);
@@ -68,8 +88,8 @@
public void testMessageRetransmission () throws AxisFault,InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaClientTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaClientTest.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaClientTest.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaClientTest.java Tue Apr 25 21:51:08 2006
@@ -29,23 +29,42 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContextConstants;
import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.client.SandeshaClient;
import org.apache.sandesha2.client.SandeshaClientConstants;
import org.apache.sandesha2.client.SequenceReport;
import org.apache.sandesha2.util.SandeshaUtil;
-public class SandeshaClientTest extends TestCase {
+public class SandeshaClientTest extends SandeshaTestCase {
SimpleHTTPServer httpServer = null;
+ private Log log = LogFactory.getLog(getClass());
+ int serverPort = DEFAULT_SERVER_TEST_PORT;
+
+ public SandeshaClientTest () {
+ super ("SandeshaClientTest");
+ }
public void setUp () throws AxisFault {
+
String repoPath = "target" + File.separator + "repos" + File.separator + "server";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
-
+
+
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+
+ String serverPortStr = getTestProperty("test.server.port");
+ if (serverPortStr!=null) {
- httpServer = new SimpleHTTPServer (configContext,8060);
+ try {
+ serverPort = Integer.parseInt(serverPortStr);
+ } catch (NumberFormatException e) {
+ log.error(e);
+ }
+ }
+ httpServer = new SimpleHTTPServer (configContext,serverPort);
httpServer.start();
try {
Thread.sleep(300);
@@ -67,8 +86,8 @@
public void testCreateSequenceWithOffer () throws AxisFault,InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String acksToEPR = "http://127.0.0.1:6060/axis2/services/__ANONYMOUS_SERVICE__";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaReportsTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaReportsTest.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaReportsTest.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaReportsTest.java Tue Apr 25 21:51:08 2006
@@ -48,10 +48,8 @@
import org.apache.sandesha2.client.SequenceReport;
import org.apache.sandesha2.util.SandeshaUtil;
-public class SandeshaReportsTest extends TestCase {
+public class SandeshaReportsTest extends SandeshaTestCase {
- private static Log log = LogFactory.getLog(SandeshaReportsTest.class);
-
SimpleHTTPServer httpServer = null;
private final static String applicationNamespaceName = "http://tempuri.org/";
private final static String echoString = "echoString";
@@ -59,19 +57,34 @@
private final static String Sequence = "Sequence";
private final static String echoStringResponse = "echoStringResponse";
private final static String EchoStringReturn = "EchoStringReturn";
-
+ int serverPort = DEFAULT_SERVER_TEST_PORT;
private final String ping = "ping";
+ private Log log = LogFactory.getLog(getClass());
+
+ public SandeshaReportsTest () {
+ super ("SandeshaReportsTest");
+ }
public void setUp () throws AxisFault {
String repoPath = "target" + File.separator + "repos" + File.separator + "server";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
-
+
+
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+ String serverPortStr = getTestProperty("test.server.port");
+ if (serverPortStr!=null) {
+
+ try {
+ serverPort = Integer.parseInt(serverPortStr);
+ } catch (NumberFormatException e) {
+ log.error(e);
+ }
+ }
- httpServer = new SimpleHTTPServer (configContext,8060);
+ httpServer = new SimpleHTTPServer (configContext,serverPort);
httpServer.start();
try {
Thread.sleep(300);
@@ -93,8 +106,8 @@
public void testSequenceReports () throws AxisFault,InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String acksToEPR = "http://127.0.0.1:6060/axis2/services/__ANONYMOUS_SERVICE__";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
@@ -155,8 +168,8 @@
public void testRMReport () throws AxisFault,InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaTestCase.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaTestCase.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/SandeshaTestCase.java Tue Apr 25 21:51:08 2006
@@ -8,11 +8,15 @@
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import java.io.*;
+import java.util.Properties;
+import java.util.logging.Logger;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -30,14 +34,32 @@
*/
public class SandeshaTestCase extends TestCase {
- String resourceDir = "test-resources";
-
+
+ String resourceDir = ""; //"test-resources";
+ Properties properties = null;
+ final String PROPERTY_FILE_NAME = "sandesha2-test.properties";
+ public final int DEFAULT_SERVER_TEST_PORT = 8060;
+
+ private Log log = LogFactory.getLog(getClass());
+
public SandeshaTestCase(String name) {
super(name);
File baseDir = new File("");
String testRource = baseDir.getAbsolutePath() + File.separator + "test-resources";
resourceDir = new File(testRource).getPath();
+
+ String propFileStr = resourceDir + File.separator + PROPERTY_FILE_NAME;
+ properties = new Properties ();
+
+ try {
+ FileInputStream propertyFile = new FileInputStream (new File(propFileStr));
+ properties.load(propertyFile);
+ } catch (FileNotFoundException e) {
+ log.error(e);
+ } catch (IOException e) {
+ log.error(e);
+ }
}
protected InputStreamReader getResource(String relativePath, String resourceName) {
@@ -70,14 +92,12 @@
protected SOAPEnvelope getEmptySOAPEnvelope() {
return OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
}
-
-
- private MessageContext getMessageContext() throws Exception{
- AxisConfiguration axisConfig = new AxisConfiguration ();
- ConfigurationContext configCtx = new ConfigurationContext(axisConfig);
- MessageContext msgCtx = new MessageContext();
- msgCtx.setConfigurationContext(configCtx);
- return msgCtx;
+
+ public String getTestProperty (String key) {
+ if (properties!=null)
+ return properties.getProperty(key);
+ else
+ return null;
}
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/SquenceOfferTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/SquenceOfferTest.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/SquenceOfferTest.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/SquenceOfferTest.java Tue Apr 25 21:51:08 2006
@@ -47,10 +47,8 @@
import junit.framework.TestCase;
-public class SquenceOfferTest extends TestCase {
+public class SquenceOfferTest extends SandeshaTestCase {
- private static Log log = LogFactory.getLog(SquenceOfferTest.class);
-
SimpleHTTPServer httpServer = null;
private final static String applicationNamespaceName = "http://tempuri.org/";
@@ -59,15 +57,32 @@
private final static String Sequence = "Sequence";
private final static String echoStringResponse = "echoStringResponse";
private final static String EchoStringReturn = "EchoStringReturn";
+ int serverPort = DEFAULT_SERVER_TEST_PORT;
+ private Log log = LogFactory.getLog(getClass());
+
+ public SquenceOfferTest () {
+ super ("SquenceOfferTest");
+ }
public void setUp () throws AxisFault {
+
String repoPath = "target" + File.separator + "repos" + File.separator + "server";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
-
+
+
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+
+ String serverPortStr = getTestProperty("test.server.port");
+ if (serverPortStr!=null) {
- httpServer = new SimpleHTTPServer (configContext,8060);
+ try {
+ serverPort = Integer.parseInt(serverPortStr);
+ } catch (NumberFormatException e) {
+ log.error(e);
+ }
+ }
+ httpServer = new SimpleHTTPServer (configContext,serverPort);
httpServer.start();
try {
Thread.sleep(300);
@@ -89,8 +104,8 @@
public void testSequenceOffer () throws AxisFault, InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String acksToEPR = "http://127.0.0.1:6060/axis2/services/__ANONYMOUS_SERVICE__";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AddressableEchoTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AddressableEchoTest.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AddressableEchoTest.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AddressableEchoTest.java Tue Apr 25 21:51:08 2006
@@ -22,13 +22,16 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContextConstants;
import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.SandeshaTestCase;
import org.apache.sandesha2.client.SandeshaClient;
import org.apache.sandesha2.client.SandeshaClientConstants;
import org.apache.sandesha2.client.SequenceReport;
import org.apache.sandesha2.util.SandeshaUtil;
-public class AddressableEchoTest extends TestCase {
+public class AddressableEchoTest extends SandeshaTestCase {
SimpleHTTPServer httpServer = null;
@@ -38,15 +41,32 @@
private final static String Sequence = "Sequence";
private final static String echoStringResponse = "echoStringResponse";
private final static String EchoStringReturn = "EchoStringReturn";
+ int serverPort = DEFAULT_SERVER_TEST_PORT;
+ private Log log = LogFactory.getLog(getClass());
+
+ public AddressableEchoTest () {
+ super ("AddressableEchoTest");
+ }
public void setUp () throws AxisFault {
+
String repoPath = "target" + File.separator + "repos" + File.separator + "server";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
-
+
+
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+
+ String serverPortStr = getTestProperty("test.server.port");
+ if (serverPortStr!=null) {
- httpServer = new SimpleHTTPServer (configContext,8060);
+ try {
+ serverPort = Integer.parseInt(serverPortStr);
+ } catch (NumberFormatException e) {
+ log.error(e);
+ }
+ }
+ httpServer = new SimpleHTTPServer (configContext,serverPort);
httpServer.start();
try {
Thread.sleep(300);
@@ -68,8 +88,8 @@
public void testAsyncEcho () throws AxisFault, InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String acksToEPR = "http://127.0.0.1:6060/axis2/services/__ANONYMOUS_SERVICE__";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
@@ -123,8 +143,8 @@
public void testAsyncEchoWithOffer () throws AxisFault, InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String acksToEPR = "http://127.0.0.1:6060/axis2/services/__ANONYMOUS_SERVICE__";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AddressablePingTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AddressablePingTest.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AddressablePingTest.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AddressablePingTest.java Tue Apr 25 21:51:08 2006
@@ -35,7 +35,10 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContextConstants;
import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.SandeshaTestCase;
import org.apache.sandesha2.client.SandeshaClient;
import org.apache.sandesha2.client.SandeshaClientConstants;
import org.apache.sandesha2.client.SequenceReport;
@@ -44,24 +47,39 @@
* @author Chamikara Jayalath <ch...@gmail.com>
*/
-public class AddressablePingTest extends TestCase {
+public class AddressablePingTest extends SandeshaTestCase {
SimpleHTTPServer httpServer = null;
private final String applicationNamespaceName = "http://tempuri.org/";
private final String ping = "ping";
private final String Text = "Text";
+ int serverPort = DEFAULT_SERVER_TEST_PORT;
+ private Log log = LogFactory.getLog(getClass());
+
+ public AddressablePingTest () {
+ super ("AddressablePingTest");
+ }
public void setUp () throws AxisFault {
+
String repoPath = "target" + File.separator + "repos" + File.separator + "server";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
-
+
+
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+
+ String serverPortStr = getTestProperty("test.server.port");
+ if (serverPortStr!=null) {
- configContext.setProperty("test","test");
-
- httpServer = new SimpleHTTPServer (configContext,8060);
+ try {
+ serverPort = Integer.parseInt(serverPortStr);
+ } catch (NumberFormatException e) {
+ log.error(e);
+ }
+ }
+ httpServer = new SimpleHTTPServer (configContext,serverPort);
httpServer.start();
try {
Thread.sleep(300);
@@ -83,8 +101,8 @@
public void testAsyncPing () throws AxisFault,IOException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String acksToEPR = "http://127.0.0.1:6060/axis2/services/__ANONYMOUS_SERVICE__";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AnonymousAckEchoTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AnonymousAckEchoTest.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AnonymousAckEchoTest.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AnonymousAckEchoTest.java Tue Apr 25 21:51:08 2006
@@ -22,13 +22,16 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContextConstants;
import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.SandeshaTestCase;
import org.apache.sandesha2.client.SandeshaClient;
import org.apache.sandesha2.client.SandeshaClientConstants;
import org.apache.sandesha2.client.SequenceReport;
import org.apache.sandesha2.util.SandeshaUtil;
-public class AnonymousAckEchoTest extends TestCase {
+public class AnonymousAckEchoTest extends SandeshaTestCase {
SimpleHTTPServer httpServer = null;
@@ -38,15 +41,32 @@
private final static String Sequence = "Sequence";
private final static String echoStringResponse = "echoStringResponse";
private final static String EchoStringReturn = "EchoStringReturn";
+ int serverPort = DEFAULT_SERVER_TEST_PORT;
+ private Log log = LogFactory.getLog(getClass());
+
+ public AnonymousAckEchoTest () {
+ super ("AnonymousAckEchoTest");
+ }
public void setUp () throws AxisFault {
+
String repoPath = "target" + File.separator + "repos" + File.separator + "server";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
-
+
+
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+
+ String serverPortStr = getTestProperty("test.server.port");
+ if (serverPortStr!=null) {
- httpServer = new SimpleHTTPServer (configContext,8060);
+ try {
+ serverPort = Integer.parseInt(serverPortStr);
+ } catch (NumberFormatException e) {
+ log.error(e);
+ }
+ }
+ httpServer = new SimpleHTTPServer (configContext,serverPort);
httpServer.start();
try {
Thread.sleep(300);
@@ -68,8 +88,8 @@
public void testSyncEcho () throws AxisFault, InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AnonymousPingTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AnonymousPingTest.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AnonymousPingTest.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/scenarios/AnonymousPingTest.java Tue Apr 25 21:51:08 2006
@@ -33,7 +33,10 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContextConstants;
import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.SandeshaTestCase;
import org.apache.sandesha2.client.SandeshaClient;
import org.apache.sandesha2.client.SandeshaClientConstants;
import org.apache.sandesha2.client.SequenceReport;
@@ -42,12 +45,19 @@
* @author Chamikara Jayalath <ch...@gmail.com>
*/
-public class AnonymousPingTest extends TestCase{
+public class AnonymousPingTest extends SandeshaTestCase {
SimpleHTTPServer httpServer = null;
private final String applicationNamespaceName = "http://tempuri.org/";
private final String ping = "ping";
private final String Text = "Text";
+
+ private Log log = LogFactory.getLog(getClass());
+ int serverPort = DEFAULT_SERVER_TEST_PORT;
+
+ public AnonymousPingTest () {
+ super ("AnonymousPingTest");
+ }
public void setUp () throws AxisFault {
@@ -56,8 +66,16 @@
ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+ String serverPortStr = getTestProperty("test.server.port");
+ if (serverPortStr!=null) {
+ try {
+ serverPort = Integer.parseInt(serverPortStr);
+ } catch (NumberFormatException e) {
+ log.error(e);
+ }
+ }
- httpServer = new SimpleHTTPServer (configContext,8060);
+ httpServer = new SimpleHTTPServer (configContext,serverPort);
httpServer.start();
try {
Thread.sleep(300);
@@ -79,8 +97,8 @@
public void testSyncPing () throws AxisFault,InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/AddressingVersionTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/AddressingVersionTest.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/AddressingVersionTest.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/AddressingVersionTest.java Tue Apr 25 21:51:08 2006
@@ -18,28 +18,46 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContextConstants;
import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.SandeshaTestCase;
import org.apache.sandesha2.client.SandeshaClient;
import org.apache.sandesha2.client.SandeshaClientConstants;
import org.apache.sandesha2.client.SequenceReport;
-public class AddressingVersionTest extends TestCase {
+public class AddressingVersionTest extends SandeshaTestCase {
SimpleHTTPServer httpServer = null;
private final String applicationNamespaceName = "http://tempuri.org/";
private final String ping = "ping";
private final String Text = "Text";
+ int serverPort = DEFAULT_SERVER_TEST_PORT;
+ private Log log = LogFactory.getLog(getClass());
+
+ public AddressingVersionTest () {
+ super ("AddressingVersionTest");
+ }
public void setUp () throws AxisFault {
String repoPath = "target" + File.separator + "repos" + File.separator + "server";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
- ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+ ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+ String serverPortStr = getTestProperty("test.server.port");
+ if (serverPortStr!=null) {
+
+ try {
+ serverPort = Integer.parseInt(serverPortStr);
+ } catch (NumberFormatException e) {
+ log.error(e);
+ }
+ }
- httpServer = new SimpleHTTPServer (configContext,8060);
+ httpServer = new SimpleHTTPServer (configContext,serverPort);
httpServer.start();
try {
Thread.sleep(300);
@@ -61,8 +79,8 @@
public void testAddressingFinal () throws AxisFault,InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
@@ -102,8 +120,8 @@
public void testAddressingSubmission () throws AxisFault,InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/RMVersionTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/RMVersionTest.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/RMVersionTest.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/RMVersionTest.java Tue Apr 25 21:51:08 2006
@@ -17,28 +17,47 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContextConstants;
import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.Sandesha2Constants;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.SandeshaTestCase;
import org.apache.sandesha2.client.SandeshaClient;
import org.apache.sandesha2.client.SandeshaClientConstants;
import org.apache.sandesha2.client.SequenceReport;
-public class RMVersionTest extends TestCase {
+public class RMVersionTest extends SandeshaTestCase {
SimpleHTTPServer httpServer = null;
private final String applicationNamespaceName = "http://tempuri.org/";
private final String ping = "ping";
private final String Text = "Text";
+ int serverPort = DEFAULT_SERVER_TEST_PORT;
+ private Log log = LogFactory.getLog(getClass());
+
+ public RMVersionTest () {
+ super ("RMVersionTest");
+ }
public void setUp () throws AxisFault {
String repoPath = "target" + File.separator + "repos" + File.separator + "server";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
- ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
- httpServer = new SimpleHTTPServer (configContext,8060);
+ ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+ String serverPortStr = getTestProperty("test.server.port");
+ if (serverPortStr!=null) {
+
+ try {
+ serverPort = Integer.parseInt(serverPortStr);
+ } catch (NumberFormatException e) {
+ log.error(e);
+ }
+ }
+
+ httpServer = new SimpleHTTPServer (configContext,serverPort);
httpServer.start();
try {
Thread.sleep(300);
@@ -60,8 +79,8 @@
public void testRMSubmission () throws AxisFault,InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
@@ -101,8 +120,8 @@
public void testRMOASIS () throws AxisFault,InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
Modified: webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/SOAPVersionTest.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/SOAPVersionTest.java?rev=397088&r1=397087&r2=397088&view=diff
==============================================================================
--- webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/SOAPVersionTest.java (original)
+++ webservices/sandesha/trunk/test/src/org/apache/sandesha2/versions/SOAPVersionTest.java Tue Apr 25 21:51:08 2006
@@ -18,28 +18,46 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContextConstants;
import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.SandeshaTestCase;
import org.apache.sandesha2.client.SandeshaClient;
import org.apache.sandesha2.client.SandeshaClientConstants;
import org.apache.sandesha2.client.SequenceReport;
-public class SOAPVersionTest extends TestCase {
+public class SOAPVersionTest extends SandeshaTestCase {
SimpleHTTPServer httpServer = null;
private final String applicationNamespaceName = "http://tempuri.org/";
private final String ping = "ping";
private final String Text = "Text";
+ int serverPort = DEFAULT_SERVER_TEST_PORT;
+ private Log log = LogFactory.getLog(getClass());
+
+ public SOAPVersionTest () {
+ super ("SOAPVersionTest");
+ }
public void setUp () throws AxisFault {
String repoPath = "target" + File.separator + "repos" + File.separator + "server";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
- ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+ ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+ String serverPortStr = getTestProperty("test.server.port");
+ if (serverPortStr!=null) {
+
+ try {
+ serverPort = Integer.parseInt(serverPortStr);
+ } catch (NumberFormatException e) {
+ log.error(e);
+ }
+ }
- httpServer = new SimpleHTTPServer (configContext,8060);
+ httpServer = new SimpleHTTPServer (configContext,serverPort);
httpServer.start();
try {
Thread.sleep(300);
@@ -61,8 +79,8 @@
public void testSOAP11 () throws AxisFault,InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
@@ -100,8 +118,8 @@
public void testSOAP12 () throws AxisFault,InterruptedException {
- String to = "http://127.0.0.1:8060/axis2/services/RMSampleService";
- String transportTo = "http://127.0.0.1:8060/axis2/services/RMSampleService";
+ String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+ String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
String repoPath = "target" + File.separator + "repos" + File.separator + "client";
String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org