jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r508421 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/
Date Fri, 16 Feb 2007 14:26:46 GMT
Author: mreutegg
Date: Fri Feb 16 06:26:45 2007
New Revision: 508421

URL: http://svn.apache.org/viewvc?view=rev&rev=508421
Log:
JCR-747: TCK: observation tests are too restrictive

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/AddEventListenerTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventIteratorTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/LockingTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeAddedTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeMovedTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeRemovedTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeReorderTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyAddedTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyChangedTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyRemovedTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/WorkspaceOperationTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/AddEventListenerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/AddEventListenerTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/AddEventListenerTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/AddEventListenerTest.java
Fri Feb 16 06:26:45 2007
@@ -53,8 +53,8 @@
         Node n = testRootNode.addNode(nodeName1, testNodeType);
         n.addNode(nodeName2);
         testRootNode.save();
-        obsMgr.removeEventListener(listener);
         Event[] events = listener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        obsMgr.removeEventListener(listener);
         checkNodeAdded(events, new String[]{nodeName1, nodeName1 + "/" + nodeName2});
     }
 
@@ -68,8 +68,8 @@
         Node n = testRootNode.addNode(nodeName1, testNodeType);
         n.addNode(nodeName2);
         testRootNode.save();
-        obsMgr.removeEventListener(listener);
         Event[] events = listener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        obsMgr.removeEventListener(listener);
         checkNodeAdded(events, new String[]{nodeName1});
     }
 
@@ -86,8 +86,8 @@
         n1.setProperty(propertyName1, "foo");
         n2.setProperty(propertyName1, "foo");
         testRootNode.save();
-        obsMgr.removeEventListener(listener);
         Event[] events = listener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        obsMgr.removeEventListener(listener);
         checkPropertyAdded(events, new String[]{nodeName1 + "/" + propertyName1});
     }
 
@@ -107,8 +107,8 @@
 
         testRootNode.addNode(nodeName1, testNodeType);
         testRootNode.save();
-        obsMgr.removeEventListener(listener);
         Event[] events = listener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        obsMgr.removeEventListener(listener);
         assertEquals("EventListener must not receive own modification when noLocal=true",
0, events.length);
     }
 
@@ -136,8 +136,8 @@
         n1.setProperty(propertyName1, "foo");
         n2.setProperty(propertyName1, "foo");
         testRootNode.save();
-        obsMgr.removeEventListener(listener);
         Event[] events = listener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        obsMgr.removeEventListener(listener);
         checkPropertyAdded(events, new String[]{nodeName1 + "/" + propertyName1});
     }
 
@@ -168,8 +168,8 @@
         } finally {
             s.logout();
         }
-        obsMgr.removeEventListener(listener);
         Event[] events = listener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        obsMgr.removeEventListener(listener);
         checkNodeAdded(events, new String[]{nodeName1 + "/" + nodeName3});
     }
 

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventIteratorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventIteratorTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventIteratorTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventIteratorTest.java
Fri Feb 16 06:26:45 2007
@@ -53,8 +53,8 @@
         addEventListener(listener, Event.NODE_ADDED);
         testRootNode.addNode(nodeName1, testNodeType);
         testRootNode.save();
-        removeEventListener(listener);
         EventIterator events = listener.getEventIterator(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(listener);
         assertNotNull("No events delivered within " + DEFAULT_WAIT_TIMEOUT + "ms.", events);
         long size = events.getSize();
         if (size == -1) {
@@ -73,8 +73,8 @@
         testRootNode.addNode(nodeName2, testNodeType);
         testRootNode.addNode(nodeName3, testNodeType);
         testRootNode.save();
-        removeEventListener(listener);
         EventIterator events = listener.getEventIterator(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(listener);
         assertNotNull("No events delivered within " + DEFAULT_WAIT_TIMEOUT + "ms.", events);
         assertEquals("Initial call to getPosition() must return 0.", 0, events.getPosition());
         events.nextEvent();
@@ -95,8 +95,8 @@
         testRootNode.addNode(nodeName2, testNodeType);
         testRootNode.addNode(nodeName3, testNodeType);
         testRootNode.save();
-        removeEventListener(listener);
         EventIterator events = listener.getEventIterator(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(listener);
         assertNotNull("No events delivered within " + DEFAULT_WAIT_TIMEOUT + "ms.", events);
         // skip zero elements
         events.skip(0);

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventTest.java
Fri Feb 16 06:26:45 2007
@@ -42,8 +42,8 @@
         addEventListener(result, Event.NODE_ADDED);
         Node addedNode = testRootNode.addNode(nodeName1, testNodeType);
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         assertEquals("Wrong number of events returned", 1, events.length);
         String path = events[0].getPath();
         String absPath = addedNode.getPath();
@@ -75,8 +75,8 @@
         addEventListener(result, Event.NODE_ADDED);
         testRootNode.addNode(nodeName1, testNodeType);
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         assertEquals("Wrong number of events returned", 1, events.length);
         int type = events[0].getType();
         assertEquals("Event did not return correct event type", Event.NODE_ADDED, type);

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/LockingTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/LockingTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/LockingTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/LockingTest.java
Fri Feb 16 06:26:45 2007
@@ -52,8 +52,8 @@
         // now lock node. no save needed
         lockable.lock(false,true);
 
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
 
         assertEquals("Wrong number of events.", 2, events.length);
         for (int i = 0; i < events.length; i++) {
@@ -84,9 +84,9 @@
         EventResult result = new EventResult(log);
         addEventListener(result, Event.PROPERTY_REMOVED);
         lockable.unlock();
-        removeEventListener(result);
 
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         assertEquals("Wrong number of events.", 2, events.length);
         for (int i = 0; i < events.length; i++) {
             assertEquals("Wrong type of event.", Event.PROPERTY_REMOVED, events[i].getType());

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeAddedTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeAddedTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeAddedTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeAddedTest.java
Fri Feb 16 06:26:45 2007
@@ -45,8 +45,8 @@
         addEventListener(result, Event.NODE_ADDED);
         testRootNode.addNode(nodeName1, testNodeType);
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkNodeAdded(events, new String[]{nodeName1});
     }
 
@@ -60,8 +60,8 @@
         testRootNode.addNode(nodeName1, testNodeType);
         testRootNode.addNode(nodeName2, testNodeType);
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkNodeAdded(events, new String[]{nodeName1, nodeName2});
     }
 
@@ -75,8 +75,8 @@
         Node n1 = testRootNode.addNode(nodeName1, testNodeType);
         n1.addNode(nodeName2, testNodeType);
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkNodeAdded(events, new String[]{nodeName1, nodeName1 + "/" + nodeName2});
     }
 
@@ -90,8 +90,8 @@
         Node n2 = testRootNode.addNode(nodeName2, testNodeType);
         n2.remove();
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkNodeAdded(events, new String[]{nodeName1});
     }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeMovedTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeMovedTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeMovedTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeMovedTest.java
Fri Feb 16 06:26:45 2007
@@ -64,10 +64,10 @@
         addEventListener(removeNodeListener, Event.NODE_REMOVED);
         superuser.move(n1.getPath(), testRoot + "/" + nodeName3);
         testRootNode.save();
-        removeEventListener(addNodeListener);
-        removeEventListener(removeNodeListener);
         Event[] added = addNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
         Event[] removed = removeNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(addNodeListener);
+        removeEventListener(removeNodeListener);
         checkNodeAdded(added, new String[]{nodeName3});
         checkNodeRemoved(removed, new String[]{nodeName1});
     }
@@ -98,10 +98,10 @@
         addEventListener(removeNodeListener, Event.NODE_REMOVED);
         superuser.move(n2.getPath(), testRoot + "/" + nodeName2);
         testRootNode.save();
-        removeEventListener(addNodeListener);
-        removeEventListener(removeNodeListener);
         Event[] added = addNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
         Event[] removed = removeNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(addNodeListener);
+        removeEventListener(removeNodeListener);
         checkNodeAdded(added, new String[]{nodeName2});
         checkNodeRemoved(removed, new String[]{nodeName1 + "/" + nodeName2});
     }
@@ -136,10 +136,10 @@
         // remove n1
         n1.remove();
         testRootNode.save();
-        removeEventListener(addNodeListener);
-        removeEventListener(removeNodeListener);
         Event[] added = addNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
         Event[] removed = removeNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(addNodeListener);
+        removeEventListener(removeNodeListener);
         checkNodeAdded(added, new String[]{nodeName3 + "/" + nodeName2});
         checkNodeRemoved(removed, new String[]{nodeName1 + "/" + nodeName2, nodeName1});
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeRemovedTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeRemovedTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeRemovedTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeRemovedTest.java
Fri Feb 16 06:26:45 2007
@@ -47,8 +47,8 @@
         testRootNode.save();
         foo.remove();
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkNodeRemoved(events, new String[]{nodeName1});
     }
 
@@ -64,8 +64,8 @@
         testRootNode.save();
         n1.remove();
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkNodeRemoved(events, new String[]{nodeName1, nodeName1 + "/" + nodeName2});
     }
 

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeReorderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeReorderTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeReorderTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeReorderTest.java
Fri Feb 16 06:26:45 2007
@@ -75,10 +75,10 @@
         addEventListener(removeNodeListener, Event.NODE_REMOVED);
         testRootNode.orderBefore(nodeName3, nodeName2);
         testRootNode.save();
-        removeEventListener(addNodeListener);
-        removeEventListener(removeNodeListener);
         Event[] added = addNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
         Event[] removed = removeNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(addNodeListener);
+        removeEventListener(removeNodeListener);
         // either
         // 1) nodename2 has been reordered to the end
         // or:
@@ -142,10 +142,10 @@
         testRootNode.orderBefore(nodeName1 + "[3]", nodeName1 + "[2]");
         //testRootNode.orderBefore(nodeName1 + "[2]", null);
         testRootNode.save();
-        removeEventListener(addNodeListener);
-        removeEventListener(removeNodeListener);
         Event[] added = addNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
         Event[] removed = removeNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(addNodeListener);
+        removeEventListener(removeNodeListener);
         // either
         // 1) nodename1[2] has been reordered to the end
         // or:
@@ -215,10 +215,10 @@
         testRootNode.orderBefore(nodeName1 + "[2]", null);
         testRootNode.getNode(nodeName3).remove();
         testRootNode.save();
-        removeEventListener(addNodeListener);
-        removeEventListener(removeNodeListener);
         Event[] added = addNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
         Event[] removed = removeNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(addNodeListener);
+        removeEventListener(removeNodeListener);
         // either
         // 1) nodename1[2] has been reordered to the end
         // or:

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyAddedTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyAddedTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyAddedTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyAddedTest.java
Fri Feb 16 06:26:45 2007
@@ -48,8 +48,8 @@
         addEventListener(result, Event.PROPERTY_ADDED);
         testRootNode.addNode(nodeName1, testNodeType);
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         List paths = new ArrayList();
         for (int i = 0; i < events.length; i++) {
             paths.add(events[i].getPath());
@@ -70,8 +70,8 @@
         addEventListener(result, Event.PROPERTY_ADDED);
         foo.setProperty(propertyName1, "test content");
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkPropertyAdded(events, new String[]{nodeName1 + "/" + propertyName1});
     }
 
@@ -87,8 +87,8 @@
         foo.setProperty(propertyName1, "foo");
         foo.setProperty(propertyName2, "bar");
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkPropertyAdded(events, new String[]{nodeName1 + "/" + propertyName1,
                                                 nodeName1 + "/" + propertyName2});
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyChangedTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyChangedTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyChangedTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyChangedTest.java
Fri Feb 16 06:26:45 2007
@@ -54,8 +54,8 @@
         addEventListener(result, Event.PROPERTY_CHANGED);
         node.getProperty(propertyName1).setValue("foobar");
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkPropertyChanged(events, new String[]{nodeName1 + "/" + propertyName1});
     }
 
@@ -74,8 +74,8 @@
         node.getProperty(propertyName1).setValue("foobar");
         node.getProperty(propertyName2).setValue("foobar");
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkPropertyChanged(events, new String[]{nodeName1 + "/" + propertyName1,
                                                   nodeName1 + "/" + propertyName2});
     }
@@ -93,8 +93,8 @@
         node.getProperty(propertyName1).setValue("foobar");
         node.setProperty(propertyName2, "bar");    // will not fire prop changed event
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkPropertyChanged(events, new String[]{nodeName1 + "/" + propertyName1});
     }
 
@@ -127,8 +127,8 @@
         n.getProperty(propertyName1).remove();
         n.setProperty(propertyName1, v2);
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
 
         if (events.length == 1) {
             checkPropertyChanged(events, new String[]{nodeName1 + "/" + propertyName1});

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyRemovedTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyRemovedTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyRemovedTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyRemovedTest.java
Fri Feb 16 06:26:45 2007
@@ -51,8 +51,8 @@
         addEventListener(result, Event.PROPERTY_REMOVED);
         prop1.remove();
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkPropertyRemoved(events, new String[]{nodeName1 + "/" + propertyName1});
     }
 
@@ -70,8 +70,8 @@
         prop1.remove();
         prop2.remove();
         testRootNode.save();
-        removeEventListener(result);
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(result);
         checkPropertyRemoved(events, new String[]{nodeName1 + "/" + propertyName1,
                                                   nodeName1 + "/" + propertyName2});
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/WorkspaceOperationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/WorkspaceOperationTest.java?view=diff&rev=508421&r1=508420&r2=508421
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/WorkspaceOperationTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/WorkspaceOperationTest.java
Fri Feb 16 06:26:45 2007
@@ -49,8 +49,8 @@
         EventResult listener = new EventResult(log);
         addEventListener(listener, Event.NODE_ADDED);
         superuser.getWorkspace().copy(testRoot + "/" + nodeName1, testRoot + "/" + nodeName3);
-        removeEventListener(listener);
         Event[] events = listener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(listener);
         checkNodeAdded(events, new String[]{nodeName3, nodeName3 + "/" + nodeName2});
     }
 
@@ -68,10 +68,10 @@
         addEventListener(removeNodeListener, Event.NODE_REMOVED);
         superuser.getWorkspace().move(n1.getPath(), testRoot + "/" + nodeName3);
         testRootNode.save();
-        removeEventListener(addNodeListener);
-        removeEventListener(removeNodeListener);
         Event[] added = addNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
         Event[] removed = removeNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(addNodeListener);
+        removeEventListener(removeNodeListener);
         checkNodeAdded(added, new String[]{nodeName3});
         checkNodeRemoved(removed, new String[]{nodeName1});
     }
@@ -91,10 +91,10 @@
         addEventListener(removeNodeListener, Event.NODE_REMOVED);
         superuser.getWorkspace().move(n1.getPath(), n3.getPath() + "/" + nodeName4);
         testRootNode.save();
-        removeEventListener(addNodeListener);
-        removeEventListener(removeNodeListener);
         Event[] added = addNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
         Event[] removed = removeNodeListener.getEvents(DEFAULT_WAIT_TIMEOUT);
+        removeEventListener(addNodeListener);
+        removeEventListener(removeNodeListener);
         checkNodeAdded(added, new String[]{nodeName3 + "/" + nodeName4});
         checkNodeRemoved(removed, new String[]{nodeName1});
     }



Mime
View raw message