cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/2] cxf git commit: More work to try and fix randomly failing test
Date Tue, 28 Feb 2017 15:58:26 GMT
Repository: cxf
Updated Branches:
  refs/heads/master eb31ffe4f -> 8fa9b8b14


More work to try and fix randomly failing test


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7ace8c84
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7ace8c84
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7ace8c84

Branch: refs/heads/master
Commit: 7ace8c84cff4696e365800fbba12cc789e97971f
Parents: eb31ffe
Author: Daniel Kulp <dkulp@apache.org>
Authored: Tue Feb 28 10:40:44 2017 -0500
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Tue Feb 28 10:40:44 2017 -0500

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/client/logging/RESTLoggingTest.java   | 5 ++++-
 .../org/apache/cxf/jaxrs/client/logging/TestEventSender.java   | 6 +++---
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7ace8c84/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/logging/RESTLoggingTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/logging/RESTLoggingTest.java
b/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/logging/RESTLoggingTest.java
index 980a744..a742caf 100644
--- a/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/logging/RESTLoggingTest.java
+++ b/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/logging/RESTLoggingTest.java
@@ -64,10 +64,11 @@ public class RESTLoggingTest {
         client.get(InputStream.class).close();
         loggingFeature.setLogBinary(true);
         client.get(InputStream.class).close();
+        client.close();
+        server.stop();
         server.destroy();
 
         List<LogEvent> events = sender.getEvents();
-        Assert.assertEquals(8, events.size());
         assertLogged(events.get(0));
         assertLogged(events.get(1));
         assertNotLogged(events.get(2));
@@ -76,6 +77,8 @@ public class RESTLoggingTest {
         assertLogged(events.get(4));
         assertLogged(events.get(5));
         assertLogged(events.get(6));
+
+        Assert.assertEquals(8, events.size());
         assertLogged(events.get(7));
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/7ace8c84/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/logging/TestEventSender.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/logging/TestEventSender.java
b/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/logging/TestEventSender.java
index c247631..2585f92 100644
--- a/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/logging/TestEventSender.java
+++ b/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/logging/TestEventSender.java
@@ -18,15 +18,15 @@
  */
 package org.apache.cxf.jaxrs.client.logging;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.apache.cxf.ext.logging.event.LogEvent;
 import org.apache.cxf.ext.logging.event.LogEventSender;
 
 final class TestEventSender implements LogEventSender {
-    private final List<LogEvent> events = new ArrayList<>();
-
+    private final List<LogEvent> events = new CopyOnWriteArrayList<>();
+    
     @Override
     public void send(LogEvent event) {
         events.add(event);


Mime
View raw message