Author: coheigea
Date: Fri Oct 5 11:20:20 2012
New Revision: 1394442
URL: http://svn.apache.org/viewvc?rev=1394442&view=rev
Log:
Merged revisions 1394433 via git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1394433 | coheigea | 2012-10-05 11:21:27 +0100 (Fri, 05 Oct 2012) | 2 lines
Disable the STSClient in the CachingTest rather than create a new
one...perhaps this will help with randomly failing tests on Jenkins
........
Modified:
cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java
Modified:
cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java?rev=1394442&r1=1394441&r2=1394442&view=diff
==============================================================================
---
cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java
(original)
+++
cxf/branches/2.6.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java
Fri Oct 5 11:20:20 2012
@@ -30,9 +30,11 @@ import javax.xml.ws.soap.SOAPFaultExcept
import org.w3c.dom.Element;
import org.apache.cxf.Bus;
+import org.apache.cxf.BusException;
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.EndpointException;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.systest.sts.common.SecurityTestUtil;
import org.apache.cxf.systest.sts.deployment.STSServer;
@@ -110,7 +112,7 @@ public class CachingTest extends Abstrac
// Change the STSClient so that it can no longer find the STS
BindingProvider p = (BindingProvider)transportSaml1Port;
- p.getRequestContext().put(SecurityConstants.STS_CLIENT, new
STSClient(bus));
+ clearSTSClient(p);
// This should succeed as the token is cached
doubleIt(transportSaml1Port, 30);
@@ -158,7 +160,7 @@ public class CachingTest extends Abstrac
// Change the STSClient so that it can no longer find the STS
BindingProvider p = (BindingProvider)transportSaml1Port;
- p.getRequestContext().put(SecurityConstants.STS_CLIENT, new
STSClient(bus));
+ clearSTSClient(p);
// This should fail as it can't get the token
try {
@@ -328,6 +330,13 @@ public class CachingTest extends Abstrac
return stsClient.requestSecurityToken(endpointAddress);
}
+
+ private void clearSTSClient(BindingProvider p) throws BusException,
EndpointException {
+ STSClient stsClient =
(STSClient)p.getRequestContext().get(SecurityConstants.STS_CLIENT);
+ stsClient.setWsdlLocation(null);
+ stsClient.setLocation(null);
+ stsClient.getClient().destroy();
+ }
private static void doubleIt(DoubleItPortType port, int numToDouble) {
int resp = port.doubleIt(numToDouble);