You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2008/08/14 22:54:40 UTC

Server-integ factory inheritence is not correct

Hi,

when running server-integ tests, I have issues with the Bind test when 
running all of them in a raw, but not when running the unit tests class 
one by one (ie, running BindITest + MiscBindITest + SaslBindITest + 
SimpleBindITest fails, when running each of them one by one succeed).

The reason is that in MiscITest, the factory is never called (@Factory ( 
MiscBindIT.Factory.class )
), so the "dc=aPache,dc=org" partition is not created. Sadly, some of 
the tests expect this partition to exist :

testAnonymousBindsEnabledBaseSearch()
...
        NamingEnumeration<SearchResult> list = ctx.search( 
"dc=apache,dc=org", "(objectClass=*)", cons );
(failure)

testUserAuthOnMixedCaseSuffix()
...
        env.put( Context.PROVIDER_URL, "ldap://localhost:" + 
ldapServer.getIpPort() + "/dc=aPache,dc=org" );
...
        Attributes attrs = ctx.getAttributes( "" );
(failure)

I think that the Factory is just called once, and the called factory is 
not the correct one (ie, the factory withing the class being tested), 
but instead the first called factory.

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: Server-integ factory inheritence is not correct

Posted by Alex Karasulu <ak...@apache.org>.
Oh good sorry did not have time to get back to you on this.  Glad you found
it.

Alex

On Thu, Aug 14, 2008 at 5:06 PM, Emmanuel Lecharny <el...@gmail.com>wrote:

> Ok,
>
> I have found the reason : the cleanup level was setup to SUITE instead of
> CLASS, so the default factory was called instead of the class factory. I
> switched it back to CLASS? and now the tests are running correctly.
>
> This is a powerfull feature, but somehow complex and dangerous... Anyway,
> it works now :)
>
>
>
> Emmanuel Lecharny wrote:
>
>> Hi,
>>
>> when running server-integ tests, I have issues with the Bind test when
>> running all of them in a raw, but not when running the unit tests class one
>> by one (ie, running BindITest + MiscBindITest + SaslBindITest +
>> SimpleBindITest fails, when running each of them one by one succeed).
>>
>> The reason is that in MiscITest, the factory is never called (@Factory (
>> MiscBindIT.Factory.class )
>> ), so the "dc=aPache,dc=org" partition is not created. Sadly, some of the
>> tests expect this partition to exist :
>>
>> testAnonymousBindsEnabledBaseSearch()
>> ...
>>       NamingEnumeration<SearchResult> list = ctx.search(
>> "dc=apache,dc=org", "(objectClass=*)", cons );
>> (failure)
>>
>> testUserAuthOnMixedCaseSuffix()
>> ...
>>       env.put( Context.PROVIDER_URL, "ldap://localhost:" +
>> ldapServer.getIpPort() + "/dc=aPache,dc=org" );
>> ...
>>       Attributes attrs = ctx.getAttributes( "" );
>> (failure)
>>
>> I think that the Factory is just called once, and the called factory is
>> not the correct one (ie, the factory withing the class being tested), but
>> instead the first called factory.
>>
>>
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>


-- 
Microsoft gives you Windows, Linux gives you the whole house ...

Re: Server-integ factory inheritence is not correct

Posted by Emmanuel Lecharny <el...@gmail.com>.
Ok,

I have found the reason : the cleanup level was setup to SUITE instead 
of CLASS, so the default factory was called instead of the class 
factory. I switched it back to CLASS? and now the tests are running 
correctly.

This is a powerfull feature, but somehow complex and dangerous... 
Anyway, it works now :)


Emmanuel Lecharny wrote:
> Hi,
>
> when running server-integ tests, I have issues with the Bind test when 
> running all of them in a raw, but not when running the unit tests 
> class one by one (ie, running BindITest + MiscBindITest + 
> SaslBindITest + SimpleBindITest fails, when running each of them one 
> by one succeed).
>
> The reason is that in MiscITest, the factory is never called (@Factory 
> ( MiscBindIT.Factory.class )
> ), so the "dc=aPache,dc=org" partition is not created. Sadly, some of 
> the tests expect this partition to exist :
>
> testAnonymousBindsEnabledBaseSearch()
> ...
>        NamingEnumeration<SearchResult> list = ctx.search( 
> "dc=apache,dc=org", "(objectClass=*)", cons );
> (failure)
>
> testUserAuthOnMixedCaseSuffix()
> ...
>        env.put( Context.PROVIDER_URL, "ldap://localhost:" + 
> ldapServer.getIpPort() + "/dc=aPache,dc=org" );
> ...
>        Attributes attrs = ctx.getAttributes( "" );
> (failure)
>
> I think that the Factory is just called once, and the called factory 
> is not the correct one (ie, the factory withing the class being 
> tested), but instead the first called factory.
>


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org