jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1574039 - in /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr: ConcurrentAddReferenceTest.java observation/ObservationRefreshTest.java
Date Tue, 04 Mar 2014 11:40:03 GMT
Author: mduerig
Date: Tue Mar  4 11:40:03 2014
New Revision: 1574039

URL: http://svn.apache.org/r1574039
Log:
OAK-1267: Failure in ObservationRefreshTest
Add additional assertions to determine whether waiting for events timed out

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

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ConcurrentAddReferenceTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ConcurrentAddReferenceTest.java?rev=1574039&r1=1574038&r2=1574039&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ConcurrentAddReferenceTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ConcurrentAddReferenceTest.java
Tue Mar  4 11:40:03 2014
@@ -16,6 +16,10 @@
  */
 package org.apache.jackrabbit.oak.jcr;
 
+import static org.apache.jackrabbit.commons.JcrUtils.in;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -26,17 +30,12 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.nodetype.NodeType;
 
+import com.google.common.collect.Iterators;
 import org.junit.After;
 import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.common.collect.Iterators;
-
-import static org.apache.jackrabbit.commons.JcrUtils.in;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
 /**
  * <code>ConcurrentAddReferenceTest</code> adds nodes with multiple sessions
in separate
  * locations of the repository and creates references to a single node.
@@ -71,7 +70,7 @@ public class ConcurrentAddReferenceTest 
         session.save();
     }
 
-    @SuppressWarnings("unchecked")
+//    @SuppressWarnings("unchecked")
     @Test
     public void addReferences() throws Exception {
         Assume.assumeTrue(fixture != NodeStoreFixture.DOCUMENT_JDBC);  // FIXME OAK-1472

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationRefreshTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationRefreshTest.java?rev=1574039&r1=1574038&r2=1574039&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationRefreshTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationRefreshTest.java
Tue Mar  4 11:40:03 2014
@@ -26,6 +26,7 @@ import static javax.jcr.observation.Even
 import static javax.jcr.observation.Event.PROPERTY_CHANGED;
 import static javax.jcr.observation.Event.PROPERTY_REMOVED;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -112,12 +113,13 @@ public class ObservationRefreshTest exte
                 n.addNode("n" + i);
                 n.getSession().save();
             }
-            Timer.waitFor(CONDITION_TIMEOUT, new Condition() {
-                @Override
-                public boolean evaluate() {
-                    return listener.numAdded == 1000;
-                }
-            });
+            assertTrue("Gave up waiting for events",
+                Timer.waitFor(CONDITION_TIMEOUT, new Condition() {
+                    @Override
+                    public boolean evaluate() {
+                        return listener.numAdded == 1000;
+                    }
+                }));
             assertEquals("", listener.error);
             assertEquals("added nodes", 1000, listener.numAdded);
 
@@ -125,12 +127,13 @@ public class ObservationRefreshTest exte
                 n.getNode("n" + i).remove();
                 n.getSession().save();
             }
-            Timer.waitFor(CONDITION_TIMEOUT , new Condition() {
-                @Override
-                public boolean evaluate() {
-                    return listener.numRemoved == 1000;
-                }
-            });
+            assertTrue("Gave up waiting for events",
+                Timer.waitFor(CONDITION_TIMEOUT , new Condition() {
+                    @Override
+                    public boolean evaluate() {
+                        return listener.numRemoved == 1000;
+                    }
+                }));
             assertEquals("", listener.error);
             assertEquals("removed nodes", 1000, listener.numRemoved);
 
@@ -138,12 +141,13 @@ public class ObservationRefreshTest exte
                 n.setProperty("test" + i, "foo");
                 n.getSession().save();
             }
-            Timer.waitFor(CONDITION_TIMEOUT , new Condition() {
-                @Override
-                public boolean evaluate() {
-                    return listener.numPropsAdded == 1100;
-                }
-            });
+            assertTrue("Gave up waiting for events",
+                Timer.waitFor(CONDITION_TIMEOUT , new Condition() {
+                    @Override
+                    public boolean evaluate() {
+                        return listener.numPropsAdded == 1100;
+                    }
+                }));
             assertEquals("", listener.error);
             assertEquals("properties added", 1100, listener.numPropsAdded);
 
@@ -151,32 +155,35 @@ public class ObservationRefreshTest exte
                 n.setProperty("test" + i, i);
                 n.getSession().save();
             }
-            Timer.waitFor(CONDITION_TIMEOUT , new Condition() {
-                @Override
-                public boolean evaluate() {
-                    return listener.numPropsModified == 100;
-                }
-            });
+            assertTrue("Gave up waiting for events",
+                Timer.waitFor(CONDITION_TIMEOUT , new Condition() {
+                    @Override
+                    public boolean evaluate() {
+                        return listener.numPropsModified == 100;
+                    }
+                }));
             assertEquals("", listener.error);
             assertEquals("properties modified", 100, listener.numPropsModified);
 
             for (int i=0; i<10; i++) {
                 n.setProperty("test100", "foo");
                 n.getSession().save();
-                Timer.waitFor(CONDITION_TIMEOUT, new Condition() {
-                    @Override
-                    public boolean evaluate() {
-                        return listener.test100Exists;
-                    }
-                });
+                assertTrue("Gave up waiting for events",
+                    Timer.waitFor(CONDITION_TIMEOUT, new Condition() {
+                        @Override
+                        public boolean evaluate() {
+                            return listener.test100Exists;
+                        }
+                    }));
                 n.getProperty("test100").remove();
                 n.getSession().save();
-                Timer.waitFor(CONDITION_TIMEOUT, new Condition() {
-                    @Override
-                    public boolean evaluate() {
-                        return !listener.test100Exists;
-                    }
-                });
+                assertTrue("Gave up waiting for events",
+                    Timer.waitFor(CONDITION_TIMEOUT, new Condition() {
+                        @Override
+                        public boolean evaluate() {
+                            return !listener.test100Exists;
+                        }
+                    }));
             }
             assertEquals("", listener.error);
 
@@ -184,12 +191,13 @@ public class ObservationRefreshTest exte
                 n.getProperty("test" + i).remove();
                 n.getSession().save();
             }
-            Timer.waitFor(CONDITION_TIMEOUT , new Condition() {
-                @Override
-                public boolean evaluate() {
-                    return listener.numPropsRemoved == 1100;
-                }
-            });
+            assertTrue("Gave up waiting for events",
+                Timer.waitFor(CONDITION_TIMEOUT , new Condition() {
+                    @Override
+                    public boolean evaluate() {
+                        return listener.numPropsRemoved == 1100;
+                    }
+                }));
             assertEquals("", listener.error);
             assertEquals("properties removed", 1100, listener.numPropsRemoved);
         }



Mime
View raw message