Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88191FCAD for ; Thu, 28 Mar 2013 11:11:10 +0000 (UTC) Received: (qmail 54284 invoked by uid 500); 28 Mar 2013 11:11:09 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 54215 invoked by uid 500); 28 Mar 2013 11:11:09 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 54186 invoked by uid 99); 28 Mar 2013 11:11:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Mar 2013 11:11:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Mar 2013 11:11:06 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4F0E323889DA; Thu, 28 Mar 2013 11:10:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1462037 - in /cxf/branches/2.7.x-fixes/systests/ws-security/src/test: java/org/apache/cxf/systest/ws/action/ resources/org/apache/cxf/systest/ws/action/ resources/org/apache/cxf/systest/ws/action/client/ resources/org/apache/cxf/systest/ws... Date: Thu, 28 Mar 2013 11:10:45 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130328111046.4F0E323889DA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: coheigea Date: Thu Mar 28 11:10:45 2013 New Revision: 1462037 URL: http://svn.apache.org/r1462037 Log: Merged revisions 1462016 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1462016 | coheigea | 2013-03-28 10:14:59 +0000 (Thu, 28 Mar 2013) | 2 lines Adding some sanity tests for not sending any security header to a service with a UsernameToken requirement ........ Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client/client.xml cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/server/server.xml cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/clean-policy.xml cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/created-policy.xml cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/hash-pass-policy.xml cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/no-pass-policy.xml cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/nonce-policy.xml cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/plaintext-pass-policy.xml cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/supp-token-policy.xml Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java?rev=1462037&r1=1462036&r2=1462037&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java Thu Mar 28 11:10:45 2013 @@ -79,4 +79,42 @@ public class ActionTest extends Abstract bus.shutdown(true); } + @org.junit.Test + public void testUsernameToken() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = ActionTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = ActionTest.class.getResource("DoubleItAction.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItUsernameTokenPort"); + DoubleItPortType port = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(port, PORT); + + // Successful call + port.doubleIt(25); + + // This should fail, as the client is not sending a UsernameToken + portQName = new QName(NAMESPACE, "DoubleItUsernameTokenPort2"); + port = service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(port, PORT); + + try { + port.doubleIt(25); + fail("Failure expected on not sending a UsernameToken element"); + } catch (javax.xml.ws.soap.SOAPFaultException ex) { + String error = "An error was discovered"; + assertTrue(ex.getMessage().contains(error)); + } + + + ((java.io.Closeable)port).close(); + bus.shutdown(true); + } + } Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl?rev=1462037&r1=1462036&r2=1462037&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl Thu Mar 28 11:10:45 2013 @@ -51,6 +51,12 @@ + + + + + + Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client/client.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client/client.xml?rev=1462037&r1=1462036&r2=1462037&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client/client.xml (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client/client.xml Thu Mar 28 11:10:45 2013 @@ -66,4 +66,19 @@ + + + + + + + + + + + + + + Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/server/server.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/server/server.xml?rev=1462037&r1=1462036&r2=1462037&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/server/server.xml (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/server/server.xml Thu Mar 28 11:10:45 2013 @@ -79,5 +79,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/clean-policy.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/clean-policy.xml?rev=1462037&r1=1462036&r2=1462037&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/clean-policy.xml (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/clean-policy.xml Thu Mar 28 11:10:45 2013 @@ -18,7 +18,6 @@ - Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/created-policy.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/created-policy.xml?rev=1462037&r1=1462036&r2=1462037&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/created-policy.xml (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/created-policy.xml Thu Mar 28 11:10:45 2013 @@ -18,7 +18,6 @@ - Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/hash-pass-policy.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/hash-pass-policy.xml?rev=1462037&r1=1462036&r2=1462037&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/hash-pass-policy.xml (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/hash-pass-policy.xml Thu Mar 28 11:10:45 2013 @@ -18,7 +18,6 @@ - Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/no-pass-policy.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/no-pass-policy.xml?rev=1462037&r1=1462036&r2=1462037&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/no-pass-policy.xml (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/no-pass-policy.xml Thu Mar 28 11:10:45 2013 @@ -18,7 +18,6 @@ - Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/nonce-policy.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/nonce-policy.xml?rev=1462037&r1=1462036&r2=1462037&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/nonce-policy.xml (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/nonce-policy.xml Thu Mar 28 11:10:45 2013 @@ -18,7 +18,6 @@ - Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/plaintext-pass-policy.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/plaintext-pass-policy.xml?rev=1462037&r1=1462036&r2=1462037&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/plaintext-pass-policy.xml (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/plaintext-pass-policy.xml Thu Mar 28 11:10:45 2013 @@ -18,7 +18,6 @@ - Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/supp-token-policy.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/supp-token-policy.xml?rev=1462037&r1=1462036&r2=1462037&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/supp-token-policy.xml (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/supp-token-policy.xml Thu Mar 28 11:10:45 2013 @@ -18,7 +18,6 @@ -