jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1574129 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java
Date Tue, 04 Mar 2014 16:40:34 GMT
Author: mduerig
Date: Tue Mar  4 16:40:34 2014
New Revision: 1574129

URL: http://svn.apache.org/r1574129
Log:
OAK-1491: ObservationTest failure on Windows
Use synchronized collections to ensure happens before relation holds when accessing them from
different threads

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java?rev=1574129&r1=1574128&r2=1574129&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java
Tue Mar  4 16:40:34 2014
@@ -19,6 +19,8 @@
 package org.apache.jackrabbit.oak.jcr.observation;
 
 import static com.google.common.base.Objects.equal;
+import static java.util.Collections.synchronizedList;
+import static java.util.Collections.synchronizedSet;
 import static javax.jcr.observation.Event.NODE_ADDED;
 import static javax.jcr.observation.Event.NODE_MOVED;
 import static javax.jcr.observation.Event.NODE_REMOVED;
@@ -764,8 +766,10 @@ public class ObservationTest extends Abs
     }
 
     private static class ExpectationListener implements EventListener {
-        private final Set<Expectation> expected = Sets.newCopyOnWriteArraySet();
-        private final List<Event> unexpected = Lists.newCopyOnWriteArrayList();
+        private final Set<Expectation> expected = synchronizedSet(
+                Sets.<Expectation>newCopyOnWriteArraySet());
+        private final List<Event> unexpected = synchronizedList(
+                Lists.<Event>newCopyOnWriteArrayList());
 
         private volatile Exception failed;
 



Mime
View raw message