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 1F82B10242 for ; Mon, 19 Aug 2013 10:48:42 +0000 (UTC) Received: (qmail 37577 invoked by uid 500); 19 Aug 2013 10:48:42 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 37456 invoked by uid 500); 19 Aug 2013 10:48:41 -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 37449 invoked by uid 99); 19 Aug 2013 10:48:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Aug 2013 10:48:41 +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; Mon, 19 Aug 2013 10:48:38 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A402123888E7; Mon, 19 Aug 2013 10:48:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1515351 - in /cxf/branches/2.7.x-fixes: ./ rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/LoadDistributorTest.java Date: Mon, 19 Aug 2013 10:48:17 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130819104817.A402123888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sergeyb Date: Mon Aug 19 10:48:17 2013 New Revision: 1515351 URL: http://svn.apache.org/r1515351 Log: Merged revisions 1515348 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1515348 | sergeyb | 2013-08-19 13:45:02 +0300 (Mon, 19 Aug 2013) | 1 line [CXF-5184] Updating FailoverTargetSelector to deal with cases when REQUEST_URI starts with ENDPOINT_ADDRESS, major help from Jacek Obarymski appreciated ........ Modified: cxf/branches/2.7.x-fixes/ (props changed) cxf/branches/2.7.x-fixes/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/LoadDistributorTest.java Propchange: cxf/branches/2.7.x-fixes/ ------------------------------------------------------------------------------ Merged /cxf/trunk:r1515348 Propchange: cxf/branches/2.7.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.7.x-fixes/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java?rev=1515351&r1=1515350&r2=1515351&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java (original) +++ cxf/branches/2.7.x-fixes/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java Mon Aug 19 10:48:17 2013 @@ -315,7 +315,7 @@ public class FailoverTargetSelector exte String endpointAddress, Conduit cond) { String requestURI = (String)message.get(Message.REQUEST_URI); - if (requestURI != null && endpointAddress != null && !requestURI.startsWith(endpointAddress)) { + if (requestURI != null && endpointAddress != null && !requestURI.equals(endpointAddress)) { String basePath = (String)message.get(Message.BASE_PATH); if (basePath != null && requestURI.startsWith(basePath)) { String pathInfo = requestURI.substring(basePath.length()); Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/LoadDistributorTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/LoadDistributorTest.java?rev=1515351&r1=1515350&r2=1515351&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/LoadDistributorTest.java (original) +++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/failover/LoadDistributorTest.java Mon Aug 19 10:48:17 2013 @@ -26,6 +26,7 @@ import javax.ws.rs.core.Response; import org.apache.cxf.clustering.FailoverFeature; import org.apache.cxf.clustering.FailoverTargetSelector; +import org.apache.cxf.clustering.LoadDistributorFeature; import org.apache.cxf.clustering.LoadDistributorTargetSelector; import org.apache.cxf.clustering.SequentialStrategy; import org.apache.cxf.endpoint.ConduitSelector; @@ -74,11 +75,28 @@ public class LoadDistributorTest extends } @Test - public void testSequentialStrategy() throws Exception { + public void testMultipleAltAddresses() throws Exception { FailoverFeature feature = getFeature(Server.ADDRESS2, Server.ADDRESS3); strategyTest(Server.ADDRESS1, feature); } + @Test + public void testSingleAltAddress() throws Exception { + LoadDistributorFeature feature = new LoadDistributorFeature(); + List alternateAddresses = new ArrayList(); + alternateAddresses.add(Server.ADDRESS2); + SequentialStrategy strategy = new SequentialStrategy(); + strategy.setAlternateAddresses(alternateAddresses); + feature.setStrategy(strategy); + + BookStore bookStore = getBookStore(Server.ADDRESS1, feature); + Book book = bookStore.getBook("123"); + assertEquals("unexpected id", 123L, book.getId()); + + book = bookStore.getBook("123"); + assertEquals("unexpected id", 123L, book.getId()); + } + private FailoverFeature getFeature(String ...address) { FailoverFeature feature = new FailoverFeature();