Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 80265 invoked from network); 23 Oct 2007 12:42:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Oct 2007 12:42:12 -0000 Received: (qmail 75805 invoked by uid 500); 23 Oct 2007 12:41:58 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 75779 invoked by uid 500); 23 Oct 2007 12:41:58 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 75770 invoked by uid 99); 23 Oct 2007 12:41:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Oct 2007 05:41:58 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Oct 2007 12:42:10 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9B7F17141EB for ; Tue, 23 Oct 2007 05:41:50 -0700 (PDT) Message-ID: <3894728.1193143310617.JavaMail.jira@brutus> Date: Tue, 23 Oct 2007 05:41:50 -0700 (PDT) From: "Marcel Reutegger (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Resolved: (JCR-1168) broken test in AddEventListener In-Reply-To: <8470839.1191940850657.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-1168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marcel Reutegger resolved JCR-1168. ----------------------------------- Resolution: Fixed Fix Version/s: 1.4 Applied patch (without the known.issues, because JCR-1179 has been fixed already) in revision: 587479 > broken test in AddEventListener > ------------------------------- > > Key: JCR-1168 > URL: https://issues.apache.org/jira/browse/JCR-1168 > Project: Jackrabbit > Issue Type: Bug > Components: jackrabbit-jcr-tests > Reporter: Julian Reschke > Fix For: 1.4 > > Attachments: JCR-1168-2.patch, JCR-1168.patch > > > Here's the test code, comments inline prefixed with "reschke" > /** > * Tests if {@link javax.jcr.observation.Event#NODE_ADDED} is created only > * for the specified path if isDeep is false. > */ > public void testIsDeepFalseNodeAdded() throws RepositoryException { > EventResult listener = new EventResult(log); > // reschke: we are listening for changes at testRoot/nodeName1, with isDeep==false > obsMgr.addEventListener(listener, Event.NODE_ADDED, testRoot + "/" + nodeName1, false, null, null, false); > // reschke; node at "testRoot/nodeName1" being created, the associated parent node for this event is "testRoot" > Node n = testRootNode.addNode(nodeName1, testNodeType); > // reschke: node at "testRoot/nodeName1/nodeName2" being created, the associated parent node for this event is "testRoot/nodeName1" > n.addNode(nodeName2); > testRootNode.save(); > Event[] events = listener.getEvents(DEFAULT_WAIT_TIMEOUT); > obsMgr.removeEventListener(listener); > // reschke: test case expects event with path "testRoot/nodeName1" > checkNodeAdded(events, new String[]{nodeName1}); > } > So, in plain english: > - test case listens for events where the associated parent node equals "testRoot/nodeName1", but > - it expects a single event where the Event.getPath() returns "testRoot/nodeName1". > This is incorrect (IMHO), because the associated parent node for *that* event is "testRoot". > So the correct test would be to check for: > checkNodeAdded(events, new String[]{nodeName1 + "/" + nodeName2}); > Making this change of course leads to a test failure reported against the RI. > Feedback appreciated. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.