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 8B70A104F7 for ; Mon, 3 Mar 2014 16:33:45 +0000 (UTC) Received: (qmail 74492 invoked by uid 500); 3 Mar 2014 16:33:41 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 74326 invoked by uid 500); 3 Mar 2014 16:33:40 -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 74311 invoked by uid 99); 3 Mar 2014 16:33:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2014 16:33:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 63951933C30; Mon, 3 Mar 2014 16:33:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@cxf.apache.org Date: Mon, 03 Mar 2014 16:33:40 -0000 Message-Id: In-Reply-To: <42df6e918bca4f7693e50e7c43d609cd@git.apache.org> References: <42df6e918bca4f7693e50e7c43d609cd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] git commit: Some changes from the backmerge Some changes from the backmerge Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b8d1d726 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b8d1d726 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b8d1d726 Branch: refs/heads/2.7.x-fixes Commit: b8d1d726c9dfa128b8227d66f157b14fe697da6f Parents: 0361002 Author: Colm O hEigeartaigh Authored: Mon Mar 3 16:33:18 2014 +0000 Committer: Colm O hEigeartaigh Committed: Mon Mar 3 16:33:18 2014 +0000 ---------------------------------------------------------------------- .../cxf/systest/ws/cache/CachingTest.java | 69 +++++--------------- .../org/apache/cxf/systest/ws/cache/Server.java | 41 ------------ .../cxf/systest/ws/cache/server/Server.java | 41 ++++++++++++ .../org/apache/cxf/systest/ws/cache/client.xml | 42 ------------ .../cxf/systest/ws/cache/client/client.xml | 42 ++++++++++++ .../systest/ws/cache/client/per-proxy-cache.xml | 10 +++ .../cxf/systest/ws/cache/per-proxy-cache.xml | 10 --- .../org/apache/cxf/systest/ws/cache/server.xml | 43 ------------ .../cxf/systest/ws/cache/server/server.xml | 43 ++++++++++++ 9 files changed, 153 insertions(+), 188 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/b8d1d726/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/CachingTest.java ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/CachingTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/CachingTest.java index 72fa9e3..c324e07 100644 --- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/CachingTest.java +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/CachingTest.java @@ -20,8 +20,6 @@ package org.apache.cxf.systest.ws.cache; import java.net.URL; -import java.util.Arrays; -import java.util.Collection; import javax.xml.namespace.QName; import javax.xml.ws.BindingProvider; @@ -31,32 +29,23 @@ import org.apache.cxf.Bus; import org.apache.cxf.bus.spring.SpringBusFactory; import org.apache.cxf.endpoint.Client; import org.apache.cxf.frontend.ClientProxy; +import org.apache.cxf.systest.ws.cache.server.Server; import org.apache.cxf.systest.ws.common.SecurityTestUtil; -import org.apache.cxf.systest.ws.common.TestParam; import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; import org.apache.cxf.ws.security.SecurityConstants; import org.apache.cxf.ws.security.tokenstore.TokenStore; import org.example.contract.doubleit.DoubleItPortType; import org.junit.BeforeClass; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; /** * A set of tests for token caching on the client side */ -@RunWith(value = org.junit.runners.Parameterized.class) public class CachingTest extends AbstractBusClientServerTestBase { public static final String PORT = allocatePort(Server.class); private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt"; private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService"); - final TestParam test; - - public CachingTest(TestParam type) { - this.test = type; - } - @BeforeClass public static void startServers() throws Exception { assertTrue( @@ -67,14 +56,6 @@ public class CachingTest extends AbstractBusClientServerTestBase { ); } - @Parameters(name = "{0}") - public static Collection data() { - - return Arrays.asList(new TestParam[][] {{new TestParam(PORT, false)}, - {new TestParam(PORT, true)}, - }); - } - @org.junit.AfterClass public static void cleanup() throws Exception { SecurityTestUtil.cleanup(); @@ -85,7 +66,7 @@ public class CachingTest extends AbstractBusClientServerTestBase { public void testSymmetric() throws Exception { SpringBusFactory bf = new SpringBusFactory(); - URL busFile = CachingTest.class.getResource("client.xml"); + URL busFile = CachingTest.class.getResource("client/client.xml"); Bus bus = bf.createBus(busFile.toString()); SpringBusFactory.setDefaultBus(bus); @@ -98,11 +79,7 @@ public class CachingTest extends AbstractBusClientServerTestBase { // First invocation DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class); - updateAddressPort(port, test.getPort()); - - if (test.isStreaming()) { - SecurityTestUtil.enableStreaming(port); - } + updateAddressPort(port, PORT); port.doubleIt(25); @@ -112,16 +89,12 @@ public class CachingTest extends AbstractBusClientServerTestBase { SecurityConstants.TOKEN_STORE_CACHE_INSTANCE ); assertNotNull(tokenStore); - // We expect two tokens as the identifier + SHA-1 are cached - assertEquals(tokenStore.getTokenIdentifiers().size(), 2); + // We expect 1 token + assertEquals(tokenStore.getTokenIdentifiers().size(), 1); // Second invocation port = service.getPort(portQName, DoubleItPortType.class); - updateAddressPort(port, test.getPort()); - - if (test.isStreaming()) { - SecurityTestUtil.enableStreaming(port); - } + updateAddressPort(port, PORT); port.doubleIt(35); @@ -131,8 +104,8 @@ public class CachingTest extends AbstractBusClientServerTestBase { SecurityConstants.TOKEN_STORE_CACHE_INSTANCE ); assertNotNull(tokenStore); - // There should now be 4 tokens as both proxies share the same TokenStore - assertEquals(tokenStore.getTokenIdentifiers().size(), 4); + // There should now be 2 tokens as both proxies share the same TokenStore + assertEquals(tokenStore.getTokenIdentifiers().size(), 2); ((java.io.Closeable)port).close(); bus.shutdown(true); @@ -142,7 +115,7 @@ public class CachingTest extends AbstractBusClientServerTestBase { public void testCachePerProxySymmetric() throws Exception { SpringBusFactory bf = new SpringBusFactory(); - URL busFile = CachingTest.class.getResource("client.xml"); + URL busFile = CachingTest.class.getResource("client/client.xml"); Bus bus = bf.createBus(busFile.toString()); SpringBusFactory.setDefaultBus(bus); @@ -155,19 +128,15 @@ public class CachingTest extends AbstractBusClientServerTestBase { // First invocation DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class); - updateAddressPort(port, test.getPort()); + updateAddressPort(port, PORT); ((BindingProvider)port).getRequestContext().put( SecurityConstants.CACHE_IDENTIFIER, "proxy1" ); ((BindingProvider)port).getRequestContext().put( - SecurityConstants.CACHE_CONFIG_FILE, "per-proxy-cache.xml" + SecurityConstants.CACHE_CONFIG_FILE, "client/per-proxy-cache.xml" ); - if (test.isStreaming()) { - SecurityTestUtil.enableStreaming(port); - } - port.doubleIt(25); Client client = ClientProxy.getClient(port); @@ -176,24 +145,20 @@ public class CachingTest extends AbstractBusClientServerTestBase { SecurityConstants.TOKEN_STORE_CACHE_INSTANCE ); assertNotNull(tokenStore); - // We expect two tokens as the identifier + SHA-1 are cached - assertEquals(tokenStore.getTokenIdentifiers().size(), 2); + // We expect 1 token + assertEquals(tokenStore.getTokenIdentifiers().size(), 1); // Second invocation port = service.getPort(portQName, DoubleItPortType.class); - updateAddressPort(port, test.getPort()); + updateAddressPort(port, PORT); ((BindingProvider)port).getRequestContext().put( SecurityConstants.CACHE_IDENTIFIER, "proxy2" ); ((BindingProvider)port).getRequestContext().put( - SecurityConstants.CACHE_CONFIG_FILE, "per-proxy-cache.xml" + SecurityConstants.CACHE_CONFIG_FILE, "client/per-proxy-cache.xml" ); - if (test.isStreaming()) { - SecurityTestUtil.enableStreaming(port); - } - port.doubleIt(35); client = ClientProxy.getClient(port); @@ -202,8 +167,8 @@ public class CachingTest extends AbstractBusClientServerTestBase { SecurityConstants.TOKEN_STORE_CACHE_INSTANCE ); assertNotNull(tokenStore); - // We expect two tokens as the identifier + SHA-1 are cached - assertEquals(tokenStore.getTokenIdentifiers().size(), 2); + // We expect 1 token + assertEquals(tokenStore.getTokenIdentifiers().size(), 1); ((java.io.Closeable)port).close(); bus.shutdown(true); http://git-wip-us.apache.org/repos/asf/cxf/blob/b8d1d726/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/Server.java ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/Server.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/Server.java deleted file mode 100644 index 07ce94c..0000000 --- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/Server.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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.cache; - -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); - } -} http://git-wip-us.apache.org/repos/asf/cxf/blob/b8d1d726/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/server/Server.java ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/server/Server.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/server/Server.java new file mode 100644 index 0000000..7cca824 --- /dev/null +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/cache/server/Server.java @@ -0,0 +1,41 @@ +/** + * 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.cache.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); + } +} http://git-wip-us.apache.org/repos/asf/cxf/blob/b8d1d726/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client.xml ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client.xml deleted file mode 100644 index 2962f04..0000000 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/cxf/blob/b8d1d726/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client/client.xml ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client/client.xml new file mode 100644 index 0000000..b3284f6 --- /dev/null +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client/client.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cxf/blob/b8d1d726/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client/per-proxy-cache.xml ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client/per-proxy-cache.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client/per-proxy-cache.xml new file mode 100644 index 0000000..de11dff --- /dev/null +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/client/per-proxy-cache.xml @@ -0,0 +1,10 @@ + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cxf/blob/b8d1d726/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/per-proxy-cache.xml ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/per-proxy-cache.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/per-proxy-cache.xml deleted file mode 100644 index de11dff..0000000 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/per-proxy-cache.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/cxf/blob/b8d1d726/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/server.xml ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/server.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/server.xml deleted file mode 100644 index 1a3a27e..0000000 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/server.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/cxf/blob/b8d1d726/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/server/server.xml ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/server/server.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/server/server.xml new file mode 100644 index 0000000..d3dd0ab --- /dev/null +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/cache/server/server.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +