jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1453345 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Date Wed, 06 Mar 2013 14:32:57 GMT
Author: mreutegg
Date: Wed Mar  6 14:32:57 2013
New Revision: 1453345

URL: http://svn.apache.org/r1453345
Log:
OAK-677: Property events on root node fail with NPE
- adding test case

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

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java?rev=1453345&r1=1453344&r2=1453345&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Wed Mar  6 14:32:57 2013
@@ -2072,6 +2072,38 @@ public class RepositoryTest extends Abst
     }
 
     @Test
+    @Ignore("OAK-677")
+    public void observationOnRootNode() throws Exception {
+        final AtomicReference<CountDownLatch> hasEvents = new AtomicReference<CountDownLatch>(new
CountDownLatch(1));
+        Session observingSession = createAdminSession();
+        try {
+            ObservationManager obsMgr = observingSession.getWorkspace().getObservationManager();
+            EventListener listener = new EventListener() {
+                @Override
+                public void onEvent(EventIterator events) {
+                    while (events.hasNext()) {
+                        events.next();
+                        hasEvents.get().countDown();
+                    }
+                }
+            };
+
+            obsMgr.addEventListener(listener, Event.PROPERTY_ADDED,
+                    "/", true, null, null, false);
+
+            // add property to root node
+            Node root = getNode("/");
+            root.setProperty("prop", "value");
+            root.getSession().save();
+
+            assertTrue(hasEvents.get().await(2, TimeUnit.SECONDS));
+            obsMgr.removeEventListener(listener);
+        } finally {
+            observingSession.logout();
+        }
+    }
+
+    @Test
     public void liveNode() throws RepositoryException {
         Session session = getAdminSession();
 



Mime
View raw message