Author: dkulp
Date: Thu Jun 7 01:35:31 2012
New Revision: 1347271
URL: http://svn.apache.org/viewvc?rev=1347271&view=rev
Log:
Fix a randomly failing test
Modified:
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java
Modified:
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java?rev=1347271&r1=1347270&r2=1347271&view=diff
==============================================================================
---
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java
(original)
+++
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java
Thu Jun 7 01:35:31 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