directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny" <elecha...@gmail.com>
Subject Re: [core] Best way to add subcontext to partition
Date Thu, 15 Mar 2007 20:27:01 GMT
So far, may be the ReferralITest is close to what you want to do : it
creates 3 sub contexts, and add entries into it, without using a LDIF file.
This test case is in server-unit :
http://svn.apache.org/viewvc/directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/ReferralITest.java?revision=499741&view=markup

Hope it helps, and also that it's not OT.

Emmanuel

On 3/15/07, Emmanuel Lecharny <elecharny@gmail.com> wrote:
>
> I'm pretty confident that we have all the API to do it without LDIF files
> (we have a lot of integration tests, and I'm pretty sure that we already
> have some of them which do exactly what you are trying to do).
>
> My concern here is that if you are trying to figure out the way to do it
> is that I can imagine that a new commer might bump his head against walls
> doing the very same ... May be a tutorial could help.
>
> Let's add a JIRA about this, and try to find the tests case which are the
> closest to your need .
>
> Emmanuel
>
> On 3/15/07, Enrique Rodriguez <enriquer9@gmail.com> wrote:
> >
> > On 3/15/07, Alex Karasulu <akarasulu@apache.org> wrote:
> > > ...
> > > However there is a means to load entries into the server using
> > convenience
> > > methods on the unit test classes.  You can also refer to an LDIF in
> > your
> > > project's respective resources area to be loaded after startup in the
> > > setUp() method.  Is this what you're looking for?
> >
> > I was hoping for something programmatic.  An LDIF to add a single OU
> > and a couple principals would work but it is generally regarded as a
> > best practice to not use external files for unit tests.  In this case
> > it's an integration test.  I'll live.
> >
> > The fundamental problem is that the startup workflow is not modular.
> > The first call to the ServerContextFactory starts both the back-end
> > and the front-end and loading an LDIF is the only recourse to affect
> > changes to the back-end prior to the front-end starting.
> >
> > Incidentally, the ServerContextFactory is not actually a context
> > factory in the JNDI sense; it just happens to extend
> > CoreContextFactory.  In other server platforms this would be it's own
> > class for starting the server.  As a separate class it could have more
> > modularity options, as well.  Anyway, we're now OT for integration
> > testing the protocols.
> >
> > Enrique
> >
>
>
>
> --
> Cordialement,
> Emmanuel L├ęcharny
> www.iktek.com




-- 
Cordialement,
Emmanuel L├ęcharny
www.iktek.com

Mime
View raw message