jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Edelson <justinedel...@gmail.com>
Subject Re: "flushing" the event queue
Date Tue, 13 Apr 2010 17:44:19 GMT
On 4/13/10 4:27 AM, Bertrand Delacretaz wrote:
> Hi Justin,
> On Mon, Apr 12, 2010 at 11:08 PM, Justin Edelson <justin@helemus.com> wrote:
>> Is there any good way to flush the event queue in Jackrabbit 2? I'm
>> trying to do this in the context of an integration test...
> The EventHelper class [1] in Sling's jcrinstall test suite allows you
> to wait until all events have been delivered, by creating a node and
> waiting for the corresponding events to arrive.
> It assumes that events are delivered in the order they were generated,
> which works so far with Jackrabbit - dunno if the JCR spec mandates
> that.
Hmmm. I'm seeing this fail some of the time, i.e. events that have
occurred BEFORE EventHelper.waitForEvents() is called haven't been
processed when that method returns.

It fails about 1/5 of the time.

According to the JCR 2 spec (12.4.1), event order isn't guaranteed.
Perhaps in JR 1.6 (the version against which JCRcInstall is tested), it
was implemented this way, but in JR 2 (the version against which I'm
testing), it isn't.

Bertrand - if you can take a look, I should be checking this code in to
Sling later today.


> -Bertrand
> [1] http://svn.apache.org/repos/asf/sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/EventHelper.java

View raw message