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 4E61E6D16 for ; Thu, 21 Jul 2011 15:13:32 +0000 (UTC) Received: (qmail 66400 invoked by uid 500); 21 Jul 2011 15:13:32 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 66267 invoked by uid 500); 21 Jul 2011 15:13:32 -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 66253 invoked by uid 99); 21 Jul 2011 15:13:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2011 15:13:31 +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, 21 Jul 2011 15:13:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 735602388980 for ; Thu, 21 Jul 2011 15:13:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1149214 - in /cxf/branches/2.4.x-fixes/systests/ws-security: ./ src/test/java/org/apache/cxf/systest/ws/kerberos/ src/test/java/org/apache/cxf/systest/ws/kerberos/client/ src/test/java/org/apache/cxf/systest/ws/kerberos/server/ src/test/ja... Date: Thu, 21 Jul 2011 15:13:00 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110721151301.735602388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: coheigea Date: Thu Jul 21 15:12:57 2011 New Revision: 1149214 URL: http://svn.apache.org/viewvc?rev=1149214&view=rev Log: Added a system test for the Kerberos Token Profile (using a mock). Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/client/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/client/KerberosCallbackHandler.java cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/DoubleItImpl.java cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/KerberosTokenValidator.java cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/Server.java cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/client/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/client/client.xml cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/server/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/server/server.xml cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/wsdl_systest_wssec/kerberos/ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/wsdl_systest_wssec/kerberos/DoubleItKerberos.wsdl Modified: cxf/branches/2.4.x-fixes/systests/ws-security/pom.xml cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/SamlTokenTest.java Modified: cxf/branches/2.4.x-fixes/systests/ws-security/pom.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/pom.xml?rev=1149214&r1=1149213&r2=1149214&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/pom.xml (original) +++ cxf/branches/2.4.x-fixes/systests/ws-security/pom.xml Thu Jul 21 15:12:57 2011 @@ -63,6 +63,9 @@ ${basedir}/src/test/resources/wsdl_systest_wssec/x509/DoubleItX509.wsdl + + ${basedir}/src/test/resources/wsdl_systest_wssec/kerberos/DoubleItKerberos.wsdl + Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java?rev=1149214&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java Thu Jul 21 15:12:57 2011 @@ -0,0 +1,247 @@ +/** + * 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.ws.kerberos; + +import java.math.BigInteger; +import java.net.URL; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; +import javax.xml.ws.BindingProvider; + +import org.apache.cxf.Bus; +import org.apache.cxf.bus.spring.SpringBusFactory; +import org.apache.cxf.systest.ws.kerberos.client.KerberosCallbackHandler; +import org.apache.cxf.systest.ws.kerberos.server.Server; +import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; +import org.apache.ws.security.WSConstants; + +import org.junit.BeforeClass; + +import wssec.kerberos.DoubleItPortType; +import wssec.kerberos.DoubleItService; + +/** + * A set of tests for Kerberos Tokens. + */ +public class KerberosTokenTest extends AbstractBusClientServerTestBase { + static final String PORT = allocatePort(Server.class); + static final String PORT2 = allocatePort(Server.class, 2); + + private boolean unrestrictedPoliciesInstalled = checkUnrestrictedPoliciesInstalled(); + + @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) + ); + } + + @org.junit.Test + public void testKerberosOverTransport() throws Exception { + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = KerberosTokenTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + DoubleItService service = new DoubleItService(); + + DoubleItPortType kerberosPort = service.getDoubleItKerberosTransportPort(); + updateAddressPort(kerberosPort, PORT2); + + try { + kerberosPort.doubleIt(BigInteger.valueOf(25)); + fail("Expected failure on an invocation with no Kerberos Token"); + } catch (javax.xml.ws.soap.SOAPFaultException ex) { + assertTrue(ex.getMessage().contains("No BST CallbackHandler available")); + } + + try { + KerberosCallbackHandler handler = new KerberosCallbackHandler(); + handler.setValueType(WSConstants.WSS_GSS_KRB_V5_AP_REQ); + ((BindingProvider)kerberosPort).getRequestContext().put( + "ws-security.bst-callback-handler", handler + ); + kerberosPort.doubleIt(BigInteger.valueOf(25)); + fail("Expected failure on an invocation with the wrong Kerberos Token"); + } catch (javax.xml.ws.soap.SOAPFaultException ex) { + assertTrue(ex.getMessage().contains("incorrect Kerberos Token Type")); + } + + ((BindingProvider)kerberosPort).getRequestContext().put( + "ws-security.bst-callback-handler", new KerberosCallbackHandler() + ); + + BigInteger result = kerberosPort.doubleIt(BigInteger.valueOf(25)); + assertTrue(result.equals(BigInteger.valueOf(50))); + } + + @org.junit.Test + public void testKerberosOverSymmetric() throws Exception { + + if (!unrestrictedPoliciesInstalled) { + return; + } + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = KerberosTokenTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + DoubleItService service = new DoubleItService(); + + DoubleItPortType kerberosPort = service.getDoubleItKerberosSymmetricPort(); + updateAddressPort(kerberosPort, PORT); + + try { + kerberosPort.doubleIt(BigInteger.valueOf(25)); + fail("Expected failure on an invocation with no Kerberos Token"); + } catch (javax.xml.ws.soap.SOAPFaultException ex) { + assertTrue(ex.getMessage().contains("No BST CallbackHandler available")); + } + + try { + KerberosCallbackHandler handler = new KerberosCallbackHandler(); + handler.setToken("123456566"); + ((BindingProvider)kerberosPort).getRequestContext().put( + "ws-security.bst-callback-handler", handler + ); + kerberosPort.doubleIt(BigInteger.valueOf(25)); + fail("Expected failure on an invocation with the wrong Kerberos Token"); + } catch (javax.xml.ws.soap.SOAPFaultException ex) { + // expected + } + + ((BindingProvider)kerberosPort).getRequestContext().put( + "ws-security.bst-callback-handler", new KerberosCallbackHandler() + ); + + BigInteger result = kerberosPort.doubleIt(BigInteger.valueOf(25)); + assertTrue(result.equals(BigInteger.valueOf(50))); + } + + @org.junit.Test + public void testKerberosOverSymmetricSupporting() throws Exception { + + if (!unrestrictedPoliciesInstalled) { + return; + } + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = KerberosTokenTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + DoubleItService service = new DoubleItService(); + + DoubleItPortType kerberosPort = service.getDoubleItKerberosSymmetricSupportingPort(); + updateAddressPort(kerberosPort, PORT); + + try { + kerberosPort.doubleIt(BigInteger.valueOf(25)); + fail("Expected failure on an invocation with no Kerberos Token"); + } catch (javax.xml.ws.soap.SOAPFaultException ex) { + assertTrue(ex.getMessage().contains("No BST CallbackHandler available")); + } + + ((BindingProvider)kerberosPort).getRequestContext().put( + "ws-security.bst-callback-handler", new KerberosCallbackHandler() + ); + + BigInteger result = kerberosPort.doubleIt(BigInteger.valueOf(25)); + assertTrue(result.equals(BigInteger.valueOf(50))); + } + + @org.junit.Test + public void testKerberosOverAsymmetric() throws Exception { + + if (!unrestrictedPoliciesInstalled) { + return; + } + + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = KerberosTokenTest.class.getResource("client/client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + DoubleItService service = new DoubleItService(); + + DoubleItPortType kerberosPort = service.getDoubleItKerberosAsymmetricPort(); + updateAddressPort(kerberosPort, PORT); + + try { + kerberosPort.doubleIt(BigInteger.valueOf(25)); + fail("Expected failure on an invocation with no Kerberos Token"); + } catch (javax.xml.ws.soap.SOAPFaultException ex) { + assertTrue(ex.getMessage().contains("No BST CallbackHandler available")); + } + + try { + ((BindingProvider)kerberosPort).getRequestContext().put( + "ws-security.bst-callback-handler", new KerberosCallbackHandler() + ); + kerberosPort.doubleIt(BigInteger.valueOf(25)); + fail("Expected failure on an invocation with the wrong Kerberos Token"); + } catch (javax.xml.ws.soap.SOAPFaultException ex) { + assertTrue(ex.getMessage().contains("incorrect Kerberos Token Type")); + } + + KerberosCallbackHandler handler = new KerberosCallbackHandler(); + handler.setValueType(WSConstants.WSS_GSS_KRB_V5_AP_REQ); + ((BindingProvider)kerberosPort).getRequestContext().put( + "ws-security.bst-callback-handler", handler + ); + + BigInteger result = kerberosPort.doubleIt(BigInteger.valueOf(25)); + assertTrue(result.equals(BigInteger.valueOf(50))); + } + + private boolean checkUnrestrictedPoliciesInstalled() { + try { + byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}; + + SecretKey key192 = new SecretKeySpec( + new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17}, + "AES"); + Cipher c = Cipher.getInstance("AES"); + c.init(Cipher.ENCRYPT_MODE, key192); + c.doFinal(data); + return true; + } catch (Exception e) { + // + } + return false; + } +} Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/client/KerberosCallbackHandler.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/client/KerberosCallbackHandler.java?rev=1149214&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/client/KerberosCallbackHandler.java (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/client/KerberosCallbackHandler.java Thu Jul 21 15:12:57 2011 @@ -0,0 +1,76 @@ +/** + * 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.ws.kerberos.client; + +import java.io.IOException; + +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.callback.UnsupportedCallbackException; + +import org.w3c.dom.Document; + +import org.apache.cxf.helpers.DOMUtils; +import org.apache.ws.security.WSConstants; +import org.apache.ws.security.message.token.BinarySecurity; +import org.apache.ws.security.message.token.TokenElementCallback; + + +/** + * A CallbackHandler instance that is used to mock up a Kerberos Token + */ +public class KerberosCallbackHandler implements CallbackHandler { + + private String valueType = WSConstants.WSS_KRB_V5_AP_REQ; + private String token = "8721958125981"; + + public KerberosCallbackHandler() { + // + } + + public void setValueType(String valueType) { + this.valueType = valueType; + } + + public void setToken(String token) { + this.token = token; + } + + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { + for (int i = 0; i < callbacks.length; i++) { + if (callbacks[i] instanceof TokenElementCallback) { + TokenElementCallback callback = (TokenElementCallback) callbacks[i]; + + // Mock up a BinarySecurityToken + Document doc = DOMUtils.createDocument(); + BinarySecurity bst = new BinarySecurity(doc); + bst.addWSSENamespace(); + bst.addWSUNamespace(); + bst.setID("BST-812847"); + bst.setValueType(valueType); + bst.setEncodingType(BinarySecurity.BASE64_ENCODING); + bst.setToken(token.getBytes()); + + callback.setTokenElement(bst.getElement()); + } + } + } + +} Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/DoubleItImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/DoubleItImpl.java?rev=1149214&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/DoubleItImpl.java (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/DoubleItImpl.java Thu Jul 21 15:12:57 2011 @@ -0,0 +1,40 @@ +/** + * 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.ws.kerberos.server; + +import java.math.BigInteger; + +import javax.jws.WebService; + +import org.apache.cxf.feature.Features; + +import wssec.kerberos.DoubleItPortType; + +@WebService(targetNamespace = "http://WSSec/kerberos", + serviceName = "DoubleItService", + endpointInterface = "wssec.kerberos.DoubleItPortType") +@Features(features = "org.apache.cxf.feature.LoggingFeature") +public class DoubleItImpl implements DoubleItPortType { + + public java.math.BigInteger doubleIt(java.math.BigInteger numberToDouble) { + return numberToDouble.multiply(BigInteger.valueOf(2)); + } + +} Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/KerberosTokenValidator.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/KerberosTokenValidator.java?rev=1149214&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/KerberosTokenValidator.java (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/KerberosTokenValidator.java Thu Jul 21 15:12:57 2011 @@ -0,0 +1,54 @@ +/** + * 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.ws.kerberos.server; + +import java.security.Principal; +import java.util.Arrays; +import java.util.List; + +import org.apache.ws.security.CustomTokenPrincipal; +import org.apache.ws.security.WSSecurityException; +import org.apache.ws.security.handler.RequestData; +import org.apache.ws.security.message.token.BinarySecurity; +import org.apache.ws.security.message.token.KerberosSecurity; +import org.apache.ws.security.validate.Credential; +import org.apache.ws.security.validate.Validator; + +/** + * This class does some trivial validation of a received (mock) Kerberos token. + */ +public class KerberosTokenValidator implements Validator { + + public Credential validate(Credential credential, RequestData data) throws WSSecurityException { + BinarySecurity binarySecurity = credential.getBinarySecurityToken(); + + if (binarySecurity instanceof KerberosSecurity) { + byte[] token = binarySecurity.getToken(); + if (!Arrays.equals(token, "8721958125981".getBytes())) { + throw new WSSecurityException(WSSecurityException.FAILURE); + } + + Principal principal = new CustomTokenPrincipal("Authenticated Principal"); + credential.setPrincipal(principal); + } + + return credential; + } + +} Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/Server.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/Server.java?rev=1149214&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/Server.java (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/server/Server.java Thu Jul 21 15:12:57 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.ws.kerberos.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 { + static final String PORT = allocatePort(Server.class); + static final String PORT2 = allocatePort(Server.class, 2); + + 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(); + } + } +} Modified: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/SamlTokenTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/SamlTokenTest.java?rev=1149214&r1=1149213&r2=1149214&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/SamlTokenTest.java (original) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/SamlTokenTest.java Thu Jul 21 15:12:57 2011 @@ -94,7 +94,7 @@ public class SamlTokenTest extends Abstr "ws-security.saml-callback-handler", new SamlCallbackHandler(false) ); BigInteger result = saml1Port.doubleIt(BigInteger.valueOf(25)); - assert result.equals(BigInteger.valueOf(50)); + assertTrue(result.equals(BigInteger.valueOf(50))); } @org.junit.Test Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/client/client.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/client/client.xml?rev=1149214&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/client/client.xml (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/client/client.xml Thu Jul 21 15:12:57 2011 @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/server/server.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/server/server.xml?rev=1149214&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/server/server.xml (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/kerberos/server/server.xml Thu Jul 21 15:12:57 2011 @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + .*_EXPORT_.* + .*_EXPORT1024_.* + .*_WITH_DES_.* + .*_WITH_NULL_.* + .*_DH_anon_.* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/wsdl_systest_wssec/kerberos/DoubleItKerberos.wsdl URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/wsdl_systest_wssec/kerberos/DoubleItKerberos.wsdl?rev=1149214&view=auto ============================================================================== --- cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/wsdl_systest_wssec/kerberos/DoubleItKerberos.wsdl (added) +++ cxf/branches/2.4.x-fixes/systests/ws-security/src/test/resources/wsdl_systest_wssec/kerberos/DoubleItKerberos.wsdl Thu Jul 21 15:12:57 2011 @@ -0,0 +1,401 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +