You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Tobias Bocanegra <tr...@apache.org> on 2014/03/06 00:52:56 UTC

Index definition with unregistered namespace

Hi,

I recently encountered a bug where someone created an index definition
in the initial content, that contains a property name with a namespace
that was never registered. something like:

IndexUtils.createIndexDefinition(builder, "test", true, false,
singleton("foo:testproperty"), null);

the index was created, but then later, accessing the index node
through JCR failed.
I wanted to create a test and an issue, but have difficulties to find
an existing test to copy from :-)

any hints?

thanks.
regards, toby

Re: Index definition with unregistered namespace

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Wed, Mar 5, 2014 at 6:52 PM, Tobias Bocanegra <tr...@apache.org> wrote:
> I recently encountered a bug where someone created an index definition
> in the initial content, that contains a property name with a namespace
> that was never registered.

The NameValidator is not run against the initial content, since we
expect that content to be internally consistent. If needed, we could
run the NameValidator against the initial content to catch such
issues.

BR,

Jukka Zitting

Re: Index definition with unregistered namespace

Posted by Tobias Bocanegra <tr...@apache.org>.
Hi,

On Thu, Mar 6, 2014 at 1:00 AM, Davide Giannella
<gi...@gmail.com> wrote:
> On 05/03/2014 23:52, Tobias Bocanegra wrote:
>> ...
>> the index was created, but then later, accessing the index node
>> through JCR failed.
>> I wanted to create a test and an issue, but have difficulties to find
>> an existing test to copy from :-)
>>
> didn't really understand what you want to test :)
I want to test adding an index definition for a property that has a
namespace that is not registered.

> but if you're looking
> at Unit Testing of PropertyIndex I would suggest to have a look at:
>
> o.a.j.o.plugins.index.* in oak-core [0]. Have a look as well at the
> strategy package. If you go up one level instead you'll find other
> indexes like `nodetype` etc.
>
> Another point is on my branch for the ordered index [1].
>
> (0) http://goo.gl/4i0JXB
> (1) http://goo.gl/Hs5rgV
>
thanks. I created an issue: https://issues.apache.org/jira/browse/OAK-1517
regards, toby

Re: Index definition with unregistered namespace

Posted by Davide Giannella <gi...@gmail.com>.
Hi Toby,

On 05/03/2014 23:52, Tobias Bocanegra wrote:
> ...
> the index was created, but then later, accessing the index node
> through JCR failed.
> I wanted to create a test and an issue, but have difficulties to find
> an existing test to copy from :-)
>
didn't really understand what you want to test :) but if you're looking
at Unit Testing of PropertyIndex I would suggest to have a look at:

o.a.j.o.plugins.index.* in oak-core [0]. Have a look as well at the
strategy package. If you go up one level instead you'll find other
indexes like `nodetype` etc.

Another point is on my branch for the ordered index [1].

(0) http://goo.gl/4i0JXB
(1) http://goo.gl/Hs5rgV

HTH
Davide