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 2021/08/03 17:43:17 UTC

[cxf] branch 3.4.x-fixes updated (2ef7652 -> fc8b005)

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 2ef7652  [CXF-8570]a test to demonstrate how to configure JAXRSClientFactoryBean with org.apache.cxf.feature.Feature to enable Client Cache
     new 0e154cc  CXF-8573: Fix org.apache.cxf.systest.jaxrs.spring.boot.SpringJaxrsTest.testJaxrsSuccessMetric
     new fc8b005  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                                      |  4 +++
 systests/spring-boot/pom.xml                       |  5 ++++
 .../spring/boot/SpringJaxrsApplicationTest.java    | 35 +++++++++++++++++++++-
 .../systest/jaxrs/spring/boot/SpringJaxrsTest.java | 29 ++++++++++++++++++
 .../systest/jaxws/spring/boot/SpringJaxwsTest.java | 21 +++++++++++++
 5 files changed, 93 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 fc8b0056fecc44fa0aa7302f26d83f5e01077752
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Tue Aug 3 13:43:06 2021 -0400

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

diff --git a/.gitmergeinfo b/.gitmergeinfo
index bf816b0..6904c44 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -104,6 +104,7 @@ M 2cd495719e7532657f7e8cad5b5347cedccd2de8
 M 2f844e251362ab62923cfc6b7061591375a1cb44
 M 37ce0562e8b98bf8fce0c15834a45ff9b5eb58e6
 M 39ff641f3d81d8e0b9487ae8c49ac2a5bf055bc1
+M 3e40a2387febaf00f47fe893d97ffdf63aaa4626
 M 4162189dabdb22aec54dc3c5ae93cf42b0575d3d
 M 420f6f35915cbd50cc175a6a10359125516b0213
 M 42c6b5c7d2bb5887ba3c19cbf26de76c0e96f721
@@ -129,8 +130,11 @@ M 67d7e562c786e5cbe0d88f82832622e6f3e7131f
 M 689ec48d044a62627ca302da6b219cb292eee36e
 M 6a77819f4bc141fcddd53a36b178972f1f68fe97
 M 6d136a2635f0fe160bff6be1dcb8e52954dcbac3
+M 6e645cb9a671c43bf61c2dd26b1363a96e94885d
 M 700cf3929763d551d9fac6c570c2560039c6238c
 M 70c7d6a1e3f23522609d58b72b61c52e3cbc919a
+M 72abe7416755fcba5943a64299d5e687661cb4c1
+M 73c22d0a0c0f98a6def324f28c4eee10bda917ea
 M 752a8a2dafff76ed8098cd73f1e071ffa0514754
 M 7a05e4fb0b67a89b86ed6eee68b9416005d6f631
 M 81d82da19ed43bbeaae12a7eda052a64890ec970

[cxf] 01/02: CXF-8573: Fix org.apache.cxf.systest.jaxrs.spring.boot.SpringJaxrsTest.testJaxrsSuccessMetric

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 0e154cc43e72809153d0d63d6ba9fa426c36d606
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Tue Aug 3 11:45:45 2021 -0400

    CXF-8573: Fix org.apache.cxf.systest.jaxrs.spring.boot.SpringJaxrsTest.testJaxrsSuccessMetric
    
    (cherry picked from commit 6e645cb9a671c43bf61c2dd26b1363a96e94885d)
    
    # Conflicts:
    #	systests/spring-boot/pom.xml
---
 systests/spring-boot/pom.xml                       |  5 ++++
 .../spring/boot/SpringJaxrsApplicationTest.java    | 35 +++++++++++++++++++++-
 .../systest/jaxrs/spring/boot/SpringJaxrsTest.java | 29 ++++++++++++++++++
 .../systest/jaxws/spring/boot/SpringJaxwsTest.java | 21 +++++++++++++
 4 files changed, 89 insertions(+), 1 deletion(-)

diff --git a/systests/spring-boot/pom.xml b/systests/spring-boot/pom.xml
index 4ec1206..b57c998 100644
--- a/systests/spring-boot/pom.xml
+++ b/systests/spring-boot/pom.xml
@@ -153,5 +153,10 @@
             <artifactId>spring-boot-starter-actuator</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.awaitility</groupId>
+            <artifactId>awaitility</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 </project>
diff --git a/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxrs/spring/boot/SpringJaxrsApplicationTest.java b/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxrs/spring/boot/SpringJaxrsApplicationTest.java
index fa4d5ec..f497a23 100644
--- a/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxrs/spring/boot/SpringJaxrsApplicationTest.java
+++ b/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxrs/spring/boot/SpringJaxrsApplicationTest.java
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.systest.jaxrs.spring.boot;
 
+import java.time.Duration;
 import java.util.Arrays;
 import java.util.Map;
 
@@ -54,6 +55,7 @@ import org.springframework.util.SocketUtils;
 
 import io.micrometer.core.instrument.MeterRegistry;
 import io.micrometer.core.instrument.Tag;
+import io.micrometer.core.instrument.search.MeterNotFoundException;
 import io.micrometer.core.instrument.search.RequiredSearch;
 
 import org.junit.Before;
@@ -65,6 +67,9 @@ import static java.util.stream.Collectors.toMap;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.entry;
+import static org.awaitility.Awaitility.await;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.Matchers.empty;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = SpringJaxrsApplicationTest.TestConfig.class)
@@ -116,7 +121,11 @@ public class SpringJaxrsApplicationTest {
         try (Response r = target.request().get()) {
             assertThat(r.getStatus()).isEqualTo(200);
         }
-        
+
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -154,6 +163,10 @@ public class SpringJaxrsApplicationTest {
             assertThat(r.getStatus()).isEqualTo(200);
         }
         
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -191,6 +204,10 @@ public class SpringJaxrsApplicationTest {
             .isInstanceOf(NotFoundException.class)
             .hasMessageContaining("Not Found");
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -228,6 +245,10 @@ public class SpringJaxrsApplicationTest {
             .isInstanceOf(InternalServerErrorException.class)
             .hasMessageContaining("Internal Server Error");
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -297,6 +318,10 @@ public class SpringJaxrsApplicationTest {
             assertThat(r.getStatus()).isEqualTo(200);
         }
         
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -334,6 +359,10 @@ public class SpringJaxrsApplicationTest {
             .isInstanceOf(InternalServerErrorException.class)
             .hasMessageContaining("Internal Server Error");
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -371,6 +400,10 @@ public class SpringJaxrsApplicationTest {
             assertThat(r.getStatus()).isEqualTo(404);
         }
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
diff --git a/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxrs/spring/boot/SpringJaxrsTest.java b/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxrs/spring/boot/SpringJaxrsTest.java
index df9eb92..630925a 100644
--- a/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxrs/spring/boot/SpringJaxrsTest.java
+++ b/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxrs/spring/boot/SpringJaxrsTest.java
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.systest.jaxrs.spring.boot;
 
+import java.time.Duration;
 import java.util.Arrays;
 import java.util.Map;
 
@@ -54,6 +55,7 @@ import org.springframework.util.SocketUtils;
 
 import io.micrometer.core.instrument.MeterRegistry;
 import io.micrometer.core.instrument.Tag;
+import io.micrometer.core.instrument.search.MeterNotFoundException;
 import io.micrometer.core.instrument.search.RequiredSearch;
 
 import org.junit.Before;
@@ -65,6 +67,9 @@ import static java.util.stream.Collectors.toMap;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.entry;
+import static org.awaitility.Awaitility.await;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.Matchers.empty;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = SpringJaxrsTest.TestConfig.class)
@@ -118,6 +123,10 @@ public class SpringJaxrsTest {
             assertThat(r.getStatus()).isEqualTo(200);
         }
         
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -155,6 +164,10 @@ public class SpringJaxrsTest {
             .isInstanceOf(NotFoundException.class)
             .hasMessageContaining("Not Found");
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -192,6 +205,10 @@ public class SpringJaxrsTest {
             .isInstanceOf(InternalServerErrorException.class)
             .hasMessageContaining("Internal Server Error");
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -261,6 +278,10 @@ public class SpringJaxrsTest {
             assertThat(r.getStatus()).isEqualTo(200);
         }
         
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -298,6 +319,10 @@ public class SpringJaxrsTest {
             .isInstanceOf(InternalServerErrorException.class)
             .hasMessageContaining("Internal Server Error");
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -335,6 +360,10 @@ public class SpringJaxrsTest {
             assertThat(r.getStatus()).isEqualTo(404);
         }
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
diff --git a/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxws/spring/boot/SpringJaxwsTest.java b/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxws/spring/boot/SpringJaxwsTest.java
index 3f6f480..1acd529 100644
--- a/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxws/spring/boot/SpringJaxwsTest.java
+++ b/systests/spring-boot/src/test/java/org/apache/cxf/systest/jaxws/spring/boot/SpringJaxwsTest.java
@@ -22,6 +22,7 @@ package org.apache.cxf.systest.jaxws.spring.boot;
 import java.io.StringReader;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.time.Duration;
 import java.util.Arrays;
 import java.util.Map;
 
@@ -58,6 +59,7 @@ import org.springframework.util.SocketUtils;
 
 import io.micrometer.core.instrument.MeterRegistry;
 import io.micrometer.core.instrument.Tag;
+import io.micrometer.core.instrument.search.MeterNotFoundException;
 import io.micrometer.core.instrument.search.RequiredSearch;
 
 import org.junit.Before;
@@ -70,6 +72,9 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.catchThrowable;
 import static org.assertj.core.api.Assertions.entry;
+import static org.awaitility.Awaitility.await;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.Matchers.empty;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
@@ -152,6 +157,10 @@ public class SpringJaxwsTest {
                         + "<return>Hello, Elan</return>"
                         + "</ns2:sayHelloResponse>");
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -197,6 +206,10 @@ public class SpringJaxwsTest {
             .hasMessageContaining("Fault occurred while processing");
 
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -260,6 +273,10 @@ public class SpringJaxwsTest {
         final HelloService api = createApi(port, HELLO_SERVICE_NAME_V1); 
         assertThat(api.sayHello("Elan")).isEqualTo("Hello, Elan");
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()
@@ -300,6 +317,10 @@ public class SpringJaxwsTest {
             .isInstanceOf(SOAPFaultException.class)
             .hasMessageContaining("Fault occurred while processing");
 
+        await()
+            .atMost(Duration.ofSeconds(1))
+            .ignoreException(MeterNotFoundException.class)
+            .until(() -> registry.get("cxf.server.requests").timers(), not(empty()));
         RequiredSearch serverRequestMetrics = registry.get("cxf.server.requests");
 
         Map<Object, Object> serverTags = serverRequestMetrics.timer().getId().getTags().stream()