You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2014/02/21 12:34:57 UTC
[2/2] git commit: Adding a testcase for CXF-5567
Adding a testcase for CXF-5567
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/60ced92f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/60ced92f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/60ced92f
Branch: refs/heads/master
Commit: 60ced92f740f2f88dd75457e22e8775de88d1a09
Parents: 2b3bb5e
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Fri Feb 21 11:34:32 2014 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Feb 21 11:34:32 2014 +0000
----------------------------------------------------------------------
.../sts/symmetric/SymmetricBindingTest.java | 43 ++++++++++++++++++++
1 file changed, 43 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/60ced92f/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java
----------------------------------------------------------------------
diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java
index 5f390ac..b478361 100644
--- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java
+++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java
@@ -285,6 +285,49 @@ public class SymmetricBindingTest extends AbstractBusClientServerTestBase {
bus.shutdown(true);
}
+ // TODO See CXF-5567
+ @org.junit.Test
+ @org.junit.Ignore
+ public void testUsernameTokenSAML1Dispatch() throws Exception {
+
+ SpringBusFactory bf = new SpringBusFactory();
+ URL busFile = SymmetricBindingTest.class.getResource("cxf-client.xml");
+
+ Bus bus = bf.createBus(busFile.toString());
+ SpringBusFactory.setDefaultBus(bus);
+ SpringBusFactory.setThreadDefaultBus(bus);
+
+ URL wsdl = SymmetricBindingTest.class.getResource("DoubleIt.wsdl");
+ Service service = Service.create(wsdl, SERVICE_QNAME);
+ QName portQName = new QName(NAMESPACE, "DoubleItSymmetricSAML1Port");
+
+ Dispatch<DOMSource> dispatch =
+ service.createDispatch(portQName, DOMSource.class, Service.Mode.PAYLOAD);
+ updateAddressPort(dispatch, test.getPort());
+
+ // Setup STSClient
+ STSClient stsClient = createDispatchSTSClient(bus);
+ String wsdlLocation = "http://localhost:" + test.getStsPort() + "/SecurityTokenService/UT?wsdl";
+ stsClient.setWsdlLocation(wsdlLocation);
+
+ // Creating a DOMSource Object for the request
+ DOMSource request = createDOMRequest();
+
+ // Make a successful request
+ Client client = ((DispatchImpl<DOMSource>) dispatch).getClient();
+ client.getRequestContext().put("ws-security.sts.client", stsClient);
+
+ if (test.isStreaming()) {
+ client.getRequestContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
+ client.getResponseContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
+ }
+
+ DOMSource response = dispatch.invoke(request);
+ assertNotNull(response);
+
+ bus.shutdown(true);
+ }
+
private DOMSource createDOMRequest() throws ParserConfigurationException {
// Creating a DOMSource Object for the request
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();