Author: coheigea
Date: Tue Mar 5 10:12:32 2013
New Revision: 1452715
URL: http://svn.apache.org/r1452715
Log:
Another attempted fix for sporadic STS test failures
Modified:
cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java
Modified:
cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java?rev=1452715&r1=1452714&r2=1452715&view=diff
==============================================================================
---
cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java
(original)
+++
cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java
Tue Mar 5 10:12:32 2013
@@ -96,7 +96,7 @@ public class CachingTest extends Abstrac
// Change the STSClient so that it can no longer find the STS
BindingProvider p = (BindingProvider)port;
- clearSTSClient(p);
+ clearSTSClient(p, bus);
// This should succeed as the token is cached
doubleIt(port, 30);
@@ -145,7 +145,7 @@ public class CachingTest extends Abstrac
// Change the STSClient so that it can no longer find the STS
BindingProvider p = (BindingProvider)port;
- clearSTSClient(p);
+ clearSTSClient(p, bus);
// This should fail as it can't get the token
try {
@@ -159,11 +159,8 @@ public class CachingTest extends Abstrac
bus.shutdown(true);
}
- private void clearSTSClient(BindingProvider p) throws BusException,
EndpointException {
- STSClient stsClient =
(STSClient)p.getRequestContext().get(SecurityConstants.STS_CLIENT);
- stsClient.getClient().destroy();
- stsClient.setWsdlLocation(null);
- stsClient.setLocation(null);
+ private void clearSTSClient(BindingProvider p, Bus bus) throws
BusException, EndpointException {
+ p.getRequestContext().put(SecurityConstants.STS_CLIENT, new
STSClient(bus));
}
private static void doubleIt(DoubleItPortType port, int numToDouble) {