Adding an @Ignore'd MTOM test
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d04f83ce Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d04f83ce Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d04f83ce Branch: refs/heads/master Commit: d04f83cecea57d92052f3bf1f4eea7f4adfac6c6 Parents: 7b9f72b Author: Colm O hEigeartaigh <[email protected]> Authored: Mon Oct 5 15:54:52 2015 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Mon Oct 5 15:55:20 2015 +0100 ---------------------------------------------------------------------- .../cxf/systest/ws/mtom/MTOMSecurityTest.java | 30 ++++++++++++++++++++ .../cxf/systest/ws/mtom/DoubleItMtom.wsdl | 21 ++++++++++++++ .../org/apache/cxf/systest/ws/mtom/client.xml | 10 +++++++ .../org/apache/cxf/systest/ws/mtom/server.xml | 10 +++++++ 4 files changed, 71 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/d04f83ce/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/mtom/MTOMSecurityTest.java ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/mtom/MTOMSecurityTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/mtom/MTOMSecurityTest.java index 3c79a43..508de4b 100644 --- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/mtom/MTOMSecurityTest.java +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/mtom/MTOMSecurityTest.java @@ -189,4 +189,34 @@ public class MTOMSecurityTest extends AbstractBusClientServerTestBase { ((java.io.Closeable)port).close(); bus.shutdown(true); } + + // The difference between this test + the testAsymmetricBytesInAttachment test above is that + // the SOAP Body already contains BASE-64 encoded content. + @org.junit.Test + @org.junit.Ignore + public void testAsymmetricBinaryBytesInAttachment() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = MTOMSecurityTest.class.getResource("client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = MTOMSecurityTest.class.getResource("DoubleItMtom.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricBinaryPort"); + DoubleItMtomPortType port = + service.getPort(portQName, DoubleItMtomPortType.class); + updateAddressPort(port, PORT); + + DataSource source = new FileDataSource(new File("src/test/resources/java.jpg")); + DoubleIt4 doubleIt = new DoubleIt4(); + doubleIt.setNumberToDouble(25); + port.doubleIt4(25, new DataHandler(source)); + + ((java.io.Closeable)port).close(); + bus.shutdown(true); + } + } http://git-wip-us.apache.org/repos/asf/cxf/blob/d04f83ce/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/DoubleItMtom.wsdl ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/DoubleItMtom.wsdl b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/DoubleItMtom.wsdl index 57bc5e9..e97c7e0 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/DoubleItMtom.wsdl +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/DoubleItMtom.wsdl @@ -34,6 +34,24 @@ </wsdl:fault> </wsdl:operation> </wsdl:binding> + <wsdl:binding name="DoubleItAsymmetricBinaryBinding" type="tns:DoubleItMtomPortType"> + <wsp:PolicyReference URI="#DoubleItAsymmetricPolicy"/> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="DoubleIt4"> + <soap:operation soapAction=""/> + <wsdl:input> + <soap:body use="literal"/> + <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Input_Policy"/> + </wsdl:input> + <wsdl:output> + <soap:body use="literal"/> + <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Output_Policy"/> + </wsdl:output> + <wsdl:fault name="DoubleItFault"> + <soap:body use="literal" name="DoubleItFault"/> + </wsdl:fault> + </wsdl:operation> + </wsdl:binding> <wsdl:binding name="DoubleItAsymmetricBinding" type="tns:DoubleItPortType"> <wsp:PolicyReference URI="#DoubleItAsymmetricPolicy"/> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> @@ -102,6 +120,9 @@ <wsdl:port name="DoubleItActionPort" binding="tns:DoubleItActionBinding"> <soap:address location="http://localhost:9001/DoubleItX509Action"/> </wsdl:port> + <wsdl:port name="DoubleItAsymmetricBinaryPort" binding="tns:DoubleItAsymmetricBinaryBinding"> + <soap:address location="http://localhost:9001/DoubleItX509AsymmetricBinary"/> + </wsdl:port> </wsdl:service> <wsp:Policy wsu:Id="DoubleItAsymmetricPolicy"> http://git-wip-us.apache.org/repos/asf/cxf/blob/d04f83ce/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/client.xml ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/client.xml index 003c64e..b915ee7 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/client.xml +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/client.xml @@ -134,5 +134,15 @@ </jaxws:properties> </jaxws:client> + <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItAsymmetricBinaryPort" createdFromAPI="true"> + <jaxws:properties> + <entry key="security.encryption.properties" value="bob.properties"/> + <entry key="security.encryption.username" value="bob"/> + <entry key="security.signature.properties" value="alice.properties"/> + <entry key="security.signature.username" value="alice"/> + <entry key="security.callback-handler" value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/> + <entry key="mtom-enabled" value="true"/> + </jaxws:properties> + </jaxws:client> </beans> http://git-wip-us.apache.org/repos/asf/cxf/blob/d04f83ce/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/server.xml ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/server.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/server.xml index 98051fb..eb1b4e9 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/server.xml +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/mtom/server.xml @@ -141,4 +141,14 @@ </jaxws:properties> </jaxws:endpoint> + <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt" id="AsymmetricBinary" address="http://localhost:${testutil.ports.mtom.Server}/DoubleItX509AsymmetricBinary" serviceName="s:DoubleItService" endpointName="s:DoubleItAsymmetricBinaryPort" implementor="org.apache.cxf.systest.ws.mtom.DoubleIt4Impl" wsdlLocation="org/apache/cxf/systest/ws/mtom/DoubleItMtom.wsdl"> + <jaxws:properties> + <entry key="security.callback-handler" value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/> + <entry key="security.signature.properties" value="bob.properties"/> + <entry key="security.encryption.properties" value="alice.properties"/> + <entry key="security.encryption.username" value="alice"/> + <entry key="mtom-enabled" value="true"/> + </jaxws:properties> + </jaxws:endpoint> + </beans>
