Author: dkulp
Date: Thu Jun 7 01:38:57 2012
New Revision: 1347277
URL: http://svn.apache.org/viewvc?rev=1347277&view=rev
Log:
Merged revisions 1347271 via svn merge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1347271 | dkulp | 2012-06-06 21:35:31 -0400 (Wed, 06 Jun 2012) | 1 line
Fix a randomly failing test
........
Modified:
cxf/branches/2.5.x-fixes/ (props changed)
cxf/branches/2.5.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java
Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.5.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java?rev=1347277&r1=1347276&r2=1347277&view=diff
==============================================================================
---
cxf/branches/2.5.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java
(original)
+++
cxf/branches/2.5.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java
Thu Jun 7 01:38:57 2012
@@ -46,6 +46,7 @@ import org.apache.cxf.greeter_control.Co
import org.apache.cxf.greeter_control.Greeter;
import org.apache.cxf.greeter_control.PingMeFault;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.transport.http.HTTPException;
import org.apache.cxf.ws.addressing.MAPAggregator;
import org.apache.cxf.ws.addressing.soap.MAPCodec;
import org.apache.cxf.wsdl.WSDLManager;
@@ -126,7 +127,7 @@ public class FailoverTest extends Abstra
bus = null;
}
}
-
+
@Test
public void testNoFailoverAcrossBindings() throws Exception {
startTarget(REPLICA_D);
@@ -162,13 +163,22 @@ public class FailoverTest extends Abstra
// in which case we should revert back to the original
// java.net.ConnectionException on the unavailable
// replica A
- //
- if (!(cause instanceof ConnectException)) {
+
+ boolean isOrig = cause instanceof ConnectException;
+ if (!isOrig) {
+ //depending on the order of the tests,
+ //the port COULD have been created, but no service deployed
+ isOrig = cause instanceof HTTPException
+ &&
cause.getMessage().contains("SoapContext/ReplicatedPortA")
+ && cause.getMessage().contains("404:");
+ }
+
+ if (!isOrig) {
cause.printStackTrace();
}
assertTrue("should revert to original exception when no failover:
"
+ cause,
- cause instanceof ConnectException);
+ isOrig);
// similarly the current endpoint referenced by the client
// should also revert back to the original replica A