You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by sa...@apache.org on 2006/01/16 16:29:34 UTC
svn commit: r369497 - in
/incubator/synapse/trunk/java/test/org/apache/synapse: environment/
spi/injection/ util/
Author: saminda
Date: Mon Jan 16 07:29:20 2006
New Revision: 369497
URL: http://svn.apache.org/viewcvs?rev=369497&view=rev
Log:
Updated test cases. As axis2-core-0.94.jar doesnot contain the addressng
mar, ServiceClient() will throw falt if .axis2 is not set. Inorder to
hide this from Synapse users,
ServiceClient(ConfigurationContext,ServiceContext) used with
ServiceCleint(configContext, null)
Modified:
incubator/synapse/trunk/java/test/org/apache/synapse/environment/EnvironmentAwareTest.java
incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/FaultProcessorWithRuleTest.java
incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/HTTPToTCPMessageMediationTest.java
incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendBackProcessorWithRuleTest.java
incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendOnProcessorWithAddressingEngageWithRuleTest.java
incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendOnProcessorWithRuleTest.java
incubator/synapse/trunk/java/test/org/apache/synapse/util/Axis2EvnSetup.java
Modified: incubator/synapse/trunk/java/test/org/apache/synapse/environment/EnvironmentAwareTest.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/test/org/apache/synapse/environment/EnvironmentAwareTest.java?rev=369497&r1=369496&r2=369497&view=diff
==============================================================================
--- incubator/synapse/trunk/java/test/org/apache/synapse/environment/EnvironmentAwareTest.java (original)
+++ incubator/synapse/trunk/java/test/org/apache/synapse/environment/EnvironmentAwareTest.java Mon Jan 16 07:29:20 2006
@@ -8,7 +8,6 @@
import org.apache.synapse.util.Axis2EvnSetup;
import junit.framework.TestCase;
-
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -32,7 +31,8 @@
"http://127.0.0.1:5043/axis2/services/anonymous");
public void setUp() throws Exception {
- synapseServer = new SimpleHTTPServer("target/synapse-repository-environmentaware",
+ synapseServer = new SimpleHTTPServer(
+ "target/synapse-repository-environmentaware",
5043);
synapseServer.start();
}
@@ -44,7 +44,9 @@
public void testSendProcessor() throws Exception {
// this test case throws exceptions if fail
// exceptions are propergated from Synapes Server
- ServiceClient serviceClient = new ServiceClient();
+ ServiceClient serviceClient = new ServiceClient(
+ Axis2EvnSetup.getConfigurationContextFromFileSystem(
+ "target/synapse-repository-environmentaware"), null);
Options options = new Options();
options.setTo(targetEpr);
serviceClient.setOptions(options);
Modified: incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/FaultProcessorWithRuleTest.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/FaultProcessorWithRuleTest.java?rev=369497&r1=369496&r2=369497&view=diff
==============================================================================
--- incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/FaultProcessorWithRuleTest.java (original)
+++ incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/FaultProcessorWithRuleTest.java Mon Jan 16 07:29:20 2006
@@ -37,7 +37,8 @@
"http://127.0.0.1:5043/axis2/services/anonymous");
public void setUp() throws Exception {
- synapseServer = new SimpleHTTPServer("target/synapse-repository-fault", 5043);
+ synapseServer =
+ new SimpleHTTPServer("target/synapse-repository-fault", 5043);
synapseServer.start();
}
@@ -46,9 +47,11 @@
}
public void testFaultPrcessor() throws Exception {
- ServiceClient serviceClient = new ServiceClient();
+ ServiceClient serviceClient = new ServiceClient(
+ Axis2EvnSetup.getConfigurationContextFromFileSystem(
+ "target/synapse-repository-fault"), null);
Options co = new Options();
- co.setTo(targetEpr);
+ co.setTo(targetEpr);
serviceClient.setOptions(co);
serviceClient.fireAndForget(Axis2EvnSetup.payload());
}
Modified: incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/HTTPToTCPMessageMediationTest.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/HTTPToTCPMessageMediationTest.java?rev=369497&r1=369496&r2=369497&view=diff
==============================================================================
--- incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/HTTPToTCPMessageMediationTest.java (original)
+++ incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/HTTPToTCPMessageMediationTest.java Mon Jan 16 07:29:20 2006
@@ -32,13 +32,14 @@
"http://127.0.0.1:5043/axis2/services/anonymous");
public void setUp() throws Exception {
- synapseServer = new SimpleHTTPServer("target/synapse-repository-httptcp",
- 5043);
+ synapseServer =
+ new SimpleHTTPServer("target/synapse-repository-httptcp",
+ 5043);
/**
* axis2TcpServer is the one who holds the actual service
*/
axis2TcpServer =
- new TCPServer(8090,"target/synapse-repository-sendonAxis2Tcp");
+ new TCPServer(8090, "target/synapse-repository-sendonAxis2Tcp");
synapseServer.start();
axis2TcpServer.start();
}
@@ -49,7 +50,9 @@
}
public void testSendProcessor() throws Exception {
- ServiceClient serviceClient = new ServiceClient();
+ ServiceClient serviceClient = new ServiceClient(
+ Axis2EvnSetup.getConfigurationContextFromFileSystem(
+ "target/synapse-repository-httptcp"), null);
Options options = new Options();
options.setTo(targetEpr);
serviceClient.setOptions(options);
Modified: incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendBackProcessorWithRuleTest.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendBackProcessorWithRuleTest.java?rev=369497&r1=369496&r2=369497&view=diff
==============================================================================
--- incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendBackProcessorWithRuleTest.java (original)
+++ incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendBackProcessorWithRuleTest.java Mon Jan 16 07:29:20 2006
@@ -41,9 +41,11 @@
}
public void testSendPrcessor() throws Exception {
- ServiceClient serviceClient = new ServiceClient();
+ ServiceClient serviceClient = new ServiceClient(
+ Axis2EvnSetup.getConfigurationContextFromFileSystem(
+ "target/synapse-repository-send"), null);
Options co = new Options();
- co.setTo(targetEpr);
+ co.setTo(targetEpr);
serviceClient.setOptions(co);
serviceClient.fireAndForget(Axis2EvnSetup.payload());
Modified: incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendOnProcessorWithAddressingEngageWithRuleTest.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendOnProcessorWithAddressingEngageWithRuleTest.java?rev=369497&r1=369496&r2=369497&view=diff
==============================================================================
--- incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendOnProcessorWithAddressingEngageWithRuleTest.java (original)
+++ incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendOnProcessorWithAddressingEngageWithRuleTest.java Mon Jan 16 07:29:20 2006
@@ -51,11 +51,14 @@
}
public void testSendProcessor() throws Exception {
- ServiceClient serviceClient = new ServiceClient();
+ ServiceClient serviceClient = new ServiceClient(
+ Axis2EvnSetup.getConfigurationContextFromFileSystem(
+ "target/synapse-repository-sendon"), null);
Options options = new Options();
options.setTo(targetEpr);
serviceClient.setOptions(options);
- OMElement response = serviceClient.sendReceive(Axis2EvnSetup.payloadNamedAdddressing());
+ OMElement response = serviceClient
+ .sendReceive(Axis2EvnSetup.payloadNamedAdddressing());
assertEquals("Synapse Testing String_Response_With_Addressing",
response.getText());
Modified: incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendOnProcessorWithRuleTest.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendOnProcessorWithRuleTest.java?rev=369497&r1=369496&r2=369497&view=diff
==============================================================================
--- incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendOnProcessorWithRuleTest.java (original)
+++ incubator/synapse/trunk/java/test/org/apache/synapse/spi/injection/SendOnProcessorWithRuleTest.java Mon Jan 16 07:29:20 2006
@@ -52,7 +52,9 @@
}
public void testSendProcessor() throws Exception {
- ServiceClient serviceClient = new ServiceClient();
+ ServiceClient serviceClient = new ServiceClient(
+ Axis2EvnSetup.getConfigurationContextFromFileSystem(
+ "target/synapse-repository-sendon"), null);
Options options = new Options();
options.setTo(targetEpr);
serviceClient.setOptions(options);
Modified: incubator/synapse/trunk/java/test/org/apache/synapse/util/Axis2EvnSetup.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/test/org/apache/synapse/util/Axis2EvnSetup.java?rev=369497&r1=369496&r2=369497&view=diff
==============================================================================
--- incubator/synapse/trunk/java/test/org/apache/synapse/util/Axis2EvnSetup.java (original)
+++ incubator/synapse/trunk/java/test/org/apache/synapse/util/Axis2EvnSetup.java Mon Jan 16 07:29:20 2006
@@ -109,4 +109,11 @@
method.addChild(value);
return method;
}
+
+ public static ConfigurationContext getConfigurationContextFromFileSystem(String repository) throws AxisFault {
+ ConfigurationContextFactory fac = new ConfigurationContextFactory();
+ ConfigurationContext configContext =
+ fac.createConfigurationContextFromFileSystem(repository);
+ return configContext;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org