Author: coheigea Date: Fri Oct 5 11:26:11 2012 New Revision: 1394448 URL: http://svn.apache.org/viewvc?rev=1394448&view=rev Log: Merged revisions 1394442 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes
........ r1394442 | coheigea | 2012-10-05 12:20:20 +0100 (Fri, 05 Oct 2012) | 10 lines 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.5.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java Modified: cxf/branches/2.5.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.5.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java?rev=1394448&r1=1394447&r2=1394448&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java (original) +++ cxf/branches/2.5.x-fixes/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/caching/CachingTest.java Fri Oct 5 11:26:11 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); @@ -157,7 +159,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 { @@ -327,6 +329,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);
