You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2022/07/07 19:07:56 UTC

[cxf] branch 3.4.x-fixes updated (0b245004a4 -> 039bff3fe7)

This is an automated email from the ASF dual-hosted git repository.

reta pushed a change to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


    from 0b245004a4 Recording .gitmergeinfo Changes
     new 228a9f0872 CXF-8735: AbstractStaticFailoverStrategy: UnsupportedOperationException when there are no services associated with the endpoint
     new 039bff3fe7 Recording .gitmergeinfo Changes

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitmergeinfo                                       |  1 +
 .../clustering/AbstractStaticFailoverStrategy.java  |  2 +-
 .../apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java | 21 +++++++++++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)


[cxf] 02/02: Recording .gitmergeinfo Changes

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 039bff3fe7dab06370998639cb296f6100bc7e13
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Thu Jul 7 15:06:42 2022 -0400

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index 00e35d0451..b4ec305008 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -3,6 +3,7 @@ origin/3.5.x-fixes
 B 0083762ff155273ee274581f85dd97a7d20b971c
 B 01608bf2a97a9daf2954da4a6e90ba7e3ae40c1c
 B 03110cf694be67611ea28e6d6cdefa0dd462e302
+B 03ccf1385b6a4c68d50ef5ecacfec7cad5dd6399
 B 04876cc1556108d78c04653cd22867fb295cfff8
 B 06db9172c41e43552897e1ec388ac96e0699c6bf
 B 097e6bf31f3341ec3fc0a08cfd1f6b65a5e97b1e


[cxf] 01/02: CXF-8735: AbstractStaticFailoverStrategy: UnsupportedOperationException when there are no services associated with the endpoint

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 228a9f08726892585ba61fe19f988530f0e50e63
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Thu Jul 7 13:33:20 2022 -0400

    CXF-8735: AbstractStaticFailoverStrategy: UnsupportedOperationException when there are no services associated with the endpoint
    
    (cherry picked from commit 9c3dc283369f6c829b040920cbb93002daf3d440)
    (cherry picked from commit 1823d59b20554658d4cfaac407d66d1c6923d57a)
    (cherry picked from commit 1a55fbe52a31643eff193e7344b666346bec4b44)
---
 .../clustering/AbstractStaticFailoverStrategy.java  |  2 +-
 .../apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/AbstractStaticFailoverStrategy.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/AbstractStaticFailoverStrategy.java
index 68535cc9f6..09755dd8f6 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/AbstractStaticFailoverStrategy.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/AbstractStaticFailoverStrategy.java
@@ -138,7 +138,7 @@ public abstract class AbstractStaticFailoverStrategy implements FailoverStrategy
         // If there are no services associated with this endpoint (often in case of JAX-RS), 
         // returning the endpoint itself if allowed.
         if (services.isEmpty() && acceptCandidatesWithSameAddress) {
-            return Collections.singletonList(endpoint);
+            return new ArrayList<>(Collections.singleton(endpoint));
         }
         
         QName currentBinding = endpoint.getBinding().getBindingInfo().getName();
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
index cee49ed4c9..eb70ed1caa 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
@@ -43,6 +43,8 @@ import javax.xml.ws.Service;
 import javax.xml.ws.soap.SOAPBinding;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.clustering.FailoverFeature;
+import org.apache.cxf.clustering.RetryStrategy;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.ext.logging.LoggingInInterceptor;
 import org.apache.cxf.ext.logging.LoggingOutInterceptor;
@@ -917,6 +919,25 @@ public class JAXRSSoapBookTest extends AbstractBusClientServerTestBase {
         }
     }
 
+    @Test
+    public void testCheckBookClientErrorResponseWithFailover() {
+        final RetryStrategy retry = new RetryStrategy();
+        retry.setMaxNumberOfRetries(1);
+
+        final FailoverFeature failoverFeature = new FailoverFeature();
+        failoverFeature.setStrategy(retry);
+        
+        String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
+        BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
+                                          BookStoreJaxrsJaxws.class,
+                                          Collections.singletonList(new DummyResponseExceptionMapper()),
+                                          Collections.singletonList(failoverFeature),
+                                          null);
+        
+        Response response = proxy.checkBook(100L);
+        assertEquals(HttpStatus.SC_NOT_FOUND, response.getStatus());
+    }
+
     private void serverFaultInInterceptorTest(String param) {
         String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
         JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();