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 DEE697CB0 for ; Fri, 9 Dec 2011 16:47:06 +0000 (UTC) Received: (qmail 58492 invoked by uid 500); 9 Dec 2011 16:47:06 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 58446 invoked by uid 500); 9 Dec 2011 16:47:06 -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 58439 invoked by uid 99); 9 Dec 2011 16:47:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Dec 2011 16:47:06 +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; Fri, 09 Dec 2011 16:46:56 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4A38A23889E1 for ; Fri, 9 Dec 2011 16:46:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1212510 - in /cxf/trunk/systests: ./ ws-security-examples/ ws-security-examples/src/ ws-security-examples/src/test/ ws-security-examples/src/test/java/ ws-security-examples/src/test/java/org/ ws-security-examples/src/test/java/org/apache/ ... Date: Fri, 09 Dec 2011 16:46:32 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111209164633.4A38A23889E1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: coheigea Date: Fri Dec 9 16:46:30 2011 New Revision: 1212510 URL: http://svn.apache.org/viewvc?rev=1212510&view=rev Log: Added a new "ws-security-examples" systests module Added: cxf/trunk/systests/ws-security-examples/ cxf/trunk/systests/ws-security-examples/pom.xml cxf/trunk/systests/ws-security-examples/src/ cxf/trunk/systests/ws-security-examples/src/test/ cxf/trunk/systests/ws-security-examples/src/test/java/ cxf/trunk/systests/ws-security-examples/src/test/java/org/ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/common/ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/common/DoubleItImpl.java cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/common/DoubleItPortTypeImpl.java cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UTPasswordCallback.java - copied, changed from r1212397, cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UsernameTokenTest.java cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/server/ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/server/Server.java cxf/trunk/systests/ws-security-examples/src/test/resources/ cxf/trunk/systests/ws-security-examples/src/test/resources/Bethal.jks cxf/trunk/systests/ws-security-examples/src/test/resources/DoubleItLogical.wsdl cxf/trunk/systests/ws-security-examples/src/test/resources/Morpit.jks cxf/trunk/systests/ws-security-examples/src/test/resources/Truststore.jks cxf/trunk/systests/ws-security-examples/src/test/resources/alice.jks cxf/trunk/systests/ws-security-examples/src/test/resources/alice.properties cxf/trunk/systests/ws-security-examples/src/test/resources/bob.jks cxf/trunk/systests/ws-security-examples/src/test/resources/bob.properties cxf/trunk/systests/ws-security-examples/src/test/resources/cxfca.jks cxf/trunk/systests/ws-security-examples/src/test/resources/log4j.properties cxf/trunk/systests/ws-security-examples/src/test/resources/logging.properties cxf/trunk/systests/ws-security-examples/src/test/resources/org/ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/DoubleItUt.wsdl cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/client/ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/client/client.xml cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/server/ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/server/server.xml Modified: cxf/trunk/systests/pom.xml cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java Modified: cxf/trunk/systests/pom.xml URL: http://svn.apache.org/viewvc/cxf/trunk/systests/pom.xml?rev=1212510&r1=1212509&r2=1212510&view=diff ============================================================================== --- cxf/trunk/systests/pom.xml (original) +++ cxf/trunk/systests/pom.xml Fri Dec 9 16:46:30 2011 @@ -42,6 +42,7 @@ jaxrs ws-specs ws-security + ws-security-example rs-security wsdl_maven Added: cxf/trunk/systests/ws-security-examples/pom.xml URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/pom.xml?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/pom.xml (added) +++ cxf/trunk/systests/ws-security-examples/pom.xml Fri Dec 9 16:46:30 2011 @@ -0,0 +1,246 @@ + + + + cxf-parent + org.apache.cxf + 2.5.1-SNAPSHOT + ../../parent/pom.xml + + 4.0.0 + org.apache.cxf.systests + cxf-systests-ws-security-examples + Apache CXF WS-Security Interop System Tests + Apache CXF WS-Security Interop System Tests + 2.5.1-SNAPSHOT + http://cxf.apache.org + + + ${basedir}/src/test/java + + + src/test/java + + **/*.java + + + + src/test/resources + + **/* + + + + + + + org.apache.cxf + cxf-codegen-plugin + ${project.version} + + + generate-sources + + ${cxf.codegenplugin.forkmode} + ${basedir}/target/generated-sources + + + ${basedir}/src/test/resources/DoubleItLogical.wsdl + + + + + wsdl2java + + + + + + maven-jar-plugin + + + attach-sources + + test-jar + + + + + + + + + ${cxf.servlet-api.group} + ${cxf.servlet-api.artifact} + + + org.apache.cxf + cxf-common-utilities + ${project.version} + + + org.apache.cxf + cxf-api + ${project.version} + + + org.apache.cxf + cxf-rt-core + ${project.version} + + + org.apache.cxf + cxf-rt-databinding-jaxb + ${project.version} + + + + org.apache.cxf + cxf-rt-frontend-jaxws + ${project.version} + + + + org.apache.cxf + cxf-rt-bindings-soap + ${project.version} + + + + org.apache.cxf + cxf-rt-transports-http + ${project.version} + + + + org.apache.cxf + cxf-rt-transports-http-jetty + ${project.version} + + + org.slf4j + slf4j-jdk14 + test + + + org.apache.cxf + cxf-rt-ws-addr + ${project.version} + + + + org.apache.cxf + cxf-rt-ws-policy + ${project.version} + + + org.apache.cxf + cxf-rt-ws-security + ${project.version} + + + org.apache.cxf + cxf-testutils + ${project.version} + test + + + asm + asm + + + + org.springframework + spring-core + + + + junit + junit + test + + + + com.sun.xml.fastinfoset + FastInfoset + + + + + pertest + + + + jaxws22 + + + org.apache.geronimo.specs + geronimo-jaxws_2.2_spec + compile + + + + + jdk15 + + 1.5 + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + create-endorsed-dir + validate + + copy + + + + + xerces + xercesImpl + ${basedir}/target/endorsed + + + xml-apis + xml-apis + 1.3.04 + ${basedir}/target/endorsed + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + -Djava.endorsed.dirs=${basedir}/target/endorsed + + + + + + + + Added: cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/common/DoubleItImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/common/DoubleItImpl.java?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/common/DoubleItImpl.java (added) +++ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/common/DoubleItImpl.java Fri Dec 9 16:46:30 2011 @@ -0,0 +1,36 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.wssec.examples.common; + +import javax.jws.WebService; + +import org.apache.cxf.feature.Features; +import org.example.contract.doubleit.DoubleItPortType; + +@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt", + serviceName = "DoubleItService", + endpointInterface = "org.example.contract.doubleit.DoubleItPortType") +@Features(features = "org.apache.cxf.feature.LoggingFeature") +public class DoubleItImpl implements DoubleItPortType { + + public int doubleIt(int numberToDouble) { + return numberToDouble * 2; + } + +} Added: cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/common/DoubleItPortTypeImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/common/DoubleItPortTypeImpl.java?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/common/DoubleItPortTypeImpl.java (added) +++ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/common/DoubleItPortTypeImpl.java Fri Dec 9 16:46:30 2011 @@ -0,0 +1,49 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.wssec.examples.common; + +import java.security.Principal; + +import javax.annotation.Resource; +import javax.jws.WebService; +import javax.xml.ws.WebServiceContext; + +import org.apache.cxf.feature.Features; +import org.example.contract.doubleit.DoubleItPortType; +import org.junit.Assert; + +@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt", + serviceName = "DoubleItService", + endpointInterface = "org.example.contract.doubleit.DoubleItPortType") +@Features(features = "org.apache.cxf.feature.LoggingFeature") +public class DoubleItPortTypeImpl implements DoubleItPortType { + + @Resource + WebServiceContext wsContext; + + public int doubleIt(int numberToDouble) { + Principal pr = wsContext.getUserPrincipal(); + + Assert.assertNotNull("Principal must not be null", pr); + Assert.assertNotNull("Principal.getName() must not return null", pr.getName()); + + return numberToDouble * 2; + } + +} Copied: cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UTPasswordCallback.java (from r1212397, cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java) URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UTPasswordCallback.java?p2=cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UTPasswordCallback.java&p1=cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java&r1=1212397&r2=1212510&rev=1212510&view=diff ============================================================================== --- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java (original) +++ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UTPasswordCallback.java Fri Dec 9 16:46:30 2011 @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.cxf.systest.ws.wssec10.client; +package org.apache.cxf.systest.wssec.examples.ut; import java.io.IOException; import java.util.HashMap; @@ -30,7 +30,6 @@ import org.apache.ws.security.WSPassword /** */ - public class UTPasswordCallback implements CallbackHandler { private Map passwords = @@ -39,9 +38,9 @@ public class UTPasswordCallback implemen public UTPasswordCallback() { passwords.put("Alice", "ecilA"); passwords.put("Frank", "knarF"); - //for MS clients passwords.put("abcd", "dcba"); passwords.put("alice", "password"); + passwords.put("bob", "password"); } /** @@ -58,11 +57,6 @@ public class UTPasswordCallback implemen return; } } - - // - // Password not found - // - throw new IOException(); } /** Added: cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UsernameTokenTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UsernameTokenTest.java?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UsernameTokenTest.java (added) +++ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UsernameTokenTest.java Fri Dec 9 16:46:30 2011 @@ -0,0 +1,220 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.systest.wssec.examples.ut; + +import java.net.URL; + +import javax.xml.namespace.QName; +import javax.xml.ws.Service; + +import org.apache.cxf.Bus; +import org.apache.cxf.bus.spring.SpringBusFactory; +import org.apache.cxf.systest.wssec.examples.ut.server.Server; +import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; + +import org.example.contract.doubleit.DoubleItPortType; + +import org.junit.BeforeClass; + +/** + * A set of tests for Username Tokens using policies defined in the OASIS spec: + * "WS-SecurityPolicy Examples Version 1.0". + */ +public class UsernameTokenTest extends AbstractBusClientServerTestBase { + static final String PORT = allocatePort(Server.class); + static final String PORT2 = allocatePort(Server.class, 2); + + private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt"; + private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService"); + + @BeforeClass + public static void startServers() throws Exception { + assertTrue( + "Server failed to launch", + // run the server in the same process + // set this to false to fork + launchServer(Server.class, true) + ); + } + + /** + * 2.1.1.1 UsernameToken with plain text password + */ + @org.junit.Test + public void testPlaintext() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = UsernameTokenTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = UsernameTokenTest.class.getResource("DoubleItUt.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItPlaintextPort"); + DoubleItPortType utPort = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(utPort, PORT); + + utPort.doubleIt(25); + } + + /** + * 2.1.1.2 UsernameToken without password + */ + @org.junit.Test + public void testPlaintextNoPassword() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = UsernameTokenTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = UsernameTokenTest.class.getResource("DoubleItUt.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItPlaintextNoPasswordPort"); + DoubleItPortType utPort = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(utPort, PORT); + + utPort.doubleIt(25); + } + + /** + * 2.1.1.3 UsernameToken with timestamp, nonce and password hash + */ + @org.junit.Test + public void testDigest() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = UsernameTokenTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = UsernameTokenTest.class.getResource("DoubleItUt.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItDigestPort"); + DoubleItPortType utPort = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(utPort, PORT); + + utPort.doubleIt(25); + } + + /** + * 2.1.2.1 UsernameToken as supporting token + */ + @org.junit.Test + public void testTLSSupporting() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = UsernameTokenTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = UsernameTokenTest.class.getResource("DoubleItUt.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItTLSSupportingPort"); + DoubleItPortType utPort = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(utPort, PORT2); + + utPort.doubleIt(25); + } + + /** + * 2.1.3 (WSS 1.0) UsernameToken with Mutual X.509v3 Authentication, Sign, Encrypt + */ + @org.junit.Test + public void testAsymmetricSESupporting() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = UsernameTokenTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = UsernameTokenTest.class.getResource("DoubleItUt.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSESupportingPort"); + DoubleItPortType utPort = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(utPort, PORT); + + utPort.doubleIt(25); + } + + /** + * 2.1.3.1 (WSS 1.0) Encrypted UsernameToken with X.509v3 + * TODO Implement when InitiatorEncryption and RecipientSignature policies + * are supported + */ + @org.junit.Test + @org.junit.Ignore + public void testAsymmetricEncrSupporting() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = UsernameTokenTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = UsernameTokenTest.class.getResource("DoubleItUt.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricEncrSupportingPort"); + DoubleItPortType utPort = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(utPort, PORT); + + utPort.doubleIt(25); + } + + /** + * 2.1.4 (WSS 1.1), User Name with Certificates, Sign, Encrypt + */ + @org.junit.Test + public void testSymmetricSESupporting() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = UsernameTokenTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = UsernameTokenTest.class.getResource("DoubleItUt.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItSymmetricSESupportingPort"); + DoubleItPortType utPort = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(utPort, PORT); + + utPort.doubleIt(25); + } +} Added: cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/server/Server.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/server/Server.java?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/server/Server.java (added) +++ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/server/Server.java Fri Dec 9 16:46:30 2011 @@ -0,0 +1,47 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.systest.wssec.examples.ut.server; + +import java.net.URL; + +import org.apache.cxf.Bus; +import org.apache.cxf.BusFactory; +import org.apache.cxf.bus.spring.SpringBusFactory; +import org.apache.cxf.testutil.common.AbstractBusTestServerBase; + +public class Server extends AbstractBusTestServerBase { + + public Server() { + + } + + protected void run() { + URL busFile = Server.class.getResource("server.xml"); + Bus busLocal = new SpringBusFactory().createBus(busFile); + BusFactory.setDefaultBus(busLocal); + setBus(busLocal); + + try { + new Server(); + } catch (Exception e) { + e.printStackTrace(); + } + } +} Added: cxf/trunk/systests/ws-security-examples/src/test/resources/Bethal.jks URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/Bethal.jks?rev=1212510&view=auto ============================================================================== Files cxf/trunk/systests/ws-security-examples/src/test/resources/Bethal.jks (added) and cxf/trunk/systests/ws-security-examples/src/test/resources/Bethal.jks Fri Dec 9 16:46:30 2011 differ Added: cxf/trunk/systests/ws-security-examples/src/test/resources/DoubleItLogical.wsdl URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/DoubleItLogical.wsdl?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/resources/DoubleItLogical.wsdl (added) +++ cxf/trunk/systests/ws-security-examples/src/test/resources/DoubleItLogical.wsdl Fri Dec 9 16:46:30 2011 @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: cxf/trunk/systests/ws-security-examples/src/test/resources/Morpit.jks URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/Morpit.jks?rev=1212510&view=auto ============================================================================== Files cxf/trunk/systests/ws-security-examples/src/test/resources/Morpit.jks (added) and cxf/trunk/systests/ws-security-examples/src/test/resources/Morpit.jks Fri Dec 9 16:46:30 2011 differ Added: cxf/trunk/systests/ws-security-examples/src/test/resources/Truststore.jks URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/Truststore.jks?rev=1212510&view=auto ============================================================================== Files cxf/trunk/systests/ws-security-examples/src/test/resources/Truststore.jks (added) and cxf/trunk/systests/ws-security-examples/src/test/resources/Truststore.jks Fri Dec 9 16:46:30 2011 differ Added: cxf/trunk/systests/ws-security-examples/src/test/resources/alice.jks URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/alice.jks?rev=1212510&view=auto ============================================================================== Files cxf/trunk/systests/ws-security-examples/src/test/resources/alice.jks (added) and cxf/trunk/systests/ws-security-examples/src/test/resources/alice.jks Fri Dec 9 16:46:30 2011 differ Added: cxf/trunk/systests/ws-security-examples/src/test/resources/alice.properties URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/alice.properties?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/resources/alice.properties (added) +++ cxf/trunk/systests/ws-security-examples/src/test/resources/alice.properties Fri Dec 9 16:46:30 2011 @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin +org.apache.ws.security.crypto.merlin.keystore.type=jks +org.apache.ws.security.crypto.merlin.keystore.password=password +org.apache.ws.security.crypto.merlin.keystore.alias=alice +org.apache.ws.security.crypto.merlin.keystore.file=alice.jks Added: cxf/trunk/systests/ws-security-examples/src/test/resources/bob.jks URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/bob.jks?rev=1212510&view=auto ============================================================================== Files cxf/trunk/systests/ws-security-examples/src/test/resources/bob.jks (added) and cxf/trunk/systests/ws-security-examples/src/test/resources/bob.jks Fri Dec 9 16:46:30 2011 differ Added: cxf/trunk/systests/ws-security-examples/src/test/resources/bob.properties URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/bob.properties?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/resources/bob.properties (added) +++ cxf/trunk/systests/ws-security-examples/src/test/resources/bob.properties Fri Dec 9 16:46:30 2011 @@ -0,0 +1,23 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin +org.apache.ws.security.crypto.merlin.keystore.type=jks +org.apache.ws.security.crypto.merlin.keystore.password=password +org.apache.ws.security.crypto.merlin.keystore.alias=bob +org.apache.ws.security.crypto.merlin.keystore.file=bob.jks + + Added: cxf/trunk/systests/ws-security-examples/src/test/resources/cxfca.jks URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/cxfca.jks?rev=1212510&view=auto ============================================================================== Files cxf/trunk/systests/ws-security-examples/src/test/resources/cxfca.jks (added) and cxf/trunk/systests/ws-security-examples/src/test/resources/cxfca.jks Fri Dec 9 16:46:30 2011 differ Added: cxf/trunk/systests/ws-security-examples/src/test/resources/log4j.properties URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/log4j.properties?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/resources/log4j.properties (added) +++ cxf/trunk/systests/ws-security-examples/src/test/resources/log4j.properties Fri Dec 9 16:46:30 2011 @@ -0,0 +1,30 @@ +# +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# + +# Global logging configuration +log4j.rootLogger=WARN, stdout + +log4j.logger.org.springframework.security=DEBUG, stdout + +# Console output... +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.conversionPattern=[%p,%c{1},%t] %m%n Added: cxf/trunk/systests/ws-security-examples/src/test/resources/logging.properties URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/logging.properties?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/resources/logging.properties (added) +++ cxf/trunk/systests/ws-security-examples/src/test/resources/logging.properties Fri Dec 9 16:46:30 2011 @@ -0,0 +1,74 @@ +# +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# +############################################################ +# Default Logging Configuration File +# +# You can use a different file by specifying a filename +# with the java.util.logging.config.file system property. +# For example java -Djava.util.logging.config.file=myfile +############################################################ + +############################################################ +# Global properties +############################################################ + +# "handlers" specifies a comma separated list of log Handler +# classes. These handlers will be installed during VM startup. +# Note that these classes must be on the system classpath. +# By default we only configure a ConsoleHandler, which will only +# show messages at the INFO and above levels. +handlers= java.util.logging.ConsoleHandler + +# To also add the FileHandler, use the following line instead. +#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler + +# Default global logging level. +# This specifies which kinds of events are logged across +# all loggers. For any given facility this global level +# can be overriden by a facility specific level +# Note that the ConsoleHandler also has a separate level +# setting to limit messages printed to the console. +.level= WARNING + +############################################################ +# Handler specific properties. +# Describes specific configuration info for Handlers. +############################################################ + +# default file output is in user's home directory. +java.util.logging.FileHandler.pattern = %h/java%u.log +java.util.logging.FileHandler.limit = 50000 +java.util.logging.FileHandler.count = 1 +java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter + +# Limit the message that are printed on the console to INFO and above. +java.util.logging.ConsoleHandler.level = SEVERE +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter + + +############################################################ +# Facility specific properties. +# Provides extra control for each logger. +############################################################ + +# For example, set the com.xyz.foo logger to only log SEVERE +# messages: +#com.xyz.foo.level = SEVERE Added: cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/DoubleItUt.wsdl URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/DoubleItUt.wsdl?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/DoubleItUt.wsdl (added) +++ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/DoubleItUt.wsdl Fri Dec 9 16:46:30 2011 @@ -0,0 +1,469 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/client/client.xml URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/client/client.xml?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/client/client.xml (added) +++ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/client/client.xml Fri Dec 9 16:46:30 2011 @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/server/server.xml URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/server/server.xml?rev=1212510&view=auto ============================================================================== --- cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/server/server.xml (added) +++ cxf/trunk/systests/ws-security-examples/src/test/resources/org/apache/cxf/systest/wssec/examples/ut/server/server.xml Fri Dec 9 16:46:30 2011 @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .*_EXPORT_.* + .*_EXPORT1024_.* + .*_WITH_DES_.* + .*_WITH_AES_.* + .*_WITH_NULL_.* + .*_DH_anon_.* + + + + + + + Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java?rev=1212510&r1=1212509&r2=1212510&view=diff ============================================================================== --- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java (original) +++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java Fri Dec 9 16:46:30 2011 @@ -58,11 +58,6 @@ public class UTPasswordCallback implemen return; } } - - // - // Password not found - // - throw new IOException(); } /**