You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by pz...@apache.org on 2006/01/13 10:57:58 UTC

svn commit: r368660 - /incubator/synapse/trunk/java/test/org/apache/synapse/spi/processors/FaultProcessorTest.java

Author: pzf
Date: Fri Jan 13 01:57:55 2006
New Revision: 368660

URL: http://svn.apache.org/viewcvs?rev=368660&view=rev
Log:
fix faultProcessor test to use ServiceClient (call deprecated)

Modified:
    incubator/synapse/trunk/java/test/org/apache/synapse/spi/processors/FaultProcessorTest.java

Modified: incubator/synapse/trunk/java/test/org/apache/synapse/spi/processors/FaultProcessorTest.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/test/org/apache/synapse/spi/processors/FaultProcessorTest.java?rev=368660&r1=368659&r2=368660&view=diff
==============================================================================
--- incubator/synapse/trunk/java/test/org/apache/synapse/spi/processors/FaultProcessorTest.java (original)
+++ incubator/synapse/trunk/java/test/org/apache/synapse/spi/processors/FaultProcessorTest.java Fri Jan 13 01:57:55 2006
@@ -1,62 +1,64 @@
 /*
-* Copyright 2004,2005 The Apache Software Foundation.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*      http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 package org.apache.synapse.spi.processors;
 
 import junit.framework.TestCase;
 import org.apache.axis2.transport.http.SimpleHTTPServer;
 import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
 import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
 
 import org.apache.axis2.AxisFault;
 import org.apache.synapse.util.Axis2EvnSetup;
 
 import javax.xml.namespace.QName;
 
-
 public class FaultProcessorTest extends TestCase {
 
-    private SimpleHTTPServer synapseServer;
-    private EndpointReference targetEpr = new EndpointReference(
-            "http://127.0.0.1:5043/axis2/services/anonymous");
-    private QName operation = new QName("anonymous");
-
-    public void setUp() throws Exception {
-        synapseServer = new SimpleHTTPServer("target/synapse-repository-fault",
-                5043);
-        synapseServer.start();
-    }
-
-    protected void tearDown() throws Exception {
-        synapseServer.stop();
-    }
-
-    public void testFaultProcessor() {
-        try {
-            Call call = new Call();
-            Options options = new Options();
-            options.setTo(targetEpr);
-            call.setClientOptions(options);
-            call.invokeBlocking(operation.getLocalPart(),
-                    Axis2EvnSetup.payload());
-            fail(null);
-        } catch (AxisFault e) {
-        }
-    }
+	private SimpleHTTPServer synapseServer;
+
+	private EndpointReference targetEpr = new EndpointReference(
+			"http://127.0.0.1:5043/axis2/services/anonymous");
+
+	private QName operation = new QName("anonymous");
+
+	public void setUp() throws Exception {
+		synapseServer = new SimpleHTTPServer("target/synapse-repository-fault",
+				5043);
+		synapseServer.start();
+	}
+
+	protected void tearDown() throws Exception {
+		synapseServer.stop();
+	}
+
+	public void testFaultProcessor() {
+		try {
+			ServiceClient sc = new ServiceClient();
+
+			Options options = new Options();
+			options.setTo(targetEpr);
+			sc.setOptions(options);
+
+			sc.sendReceive(operation, Axis2EvnSetup.payload());
+			fail(null);
+		} catch (AxisFault e) {
+		}
+	}
 
-}
+}
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org