You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Enrique Rodriguez <en...@gmail.com> on 2007/05/30 04:41:51 UTC

[ApacheDS] 2 class files moves

Hi, Directory developers,

I'd like to make 2 moves of classes:

1)  In 'server-unit' I'd like to move AbstractServerTriggerServiceTest
from src/test/java to src/main/java.  The issue is that the test
classes don't get packaged into jar artifacts so if you want to use an
abstract test outside of server-unit you can't.  This is likely why
AbstractServerTest is is src/main/java.

2)  In 'protocol-shared' there are 2 classes for loading LDIFs,
LdifFileLoader and LdifLoadFilter.  I believe these were in
protocol-shared to address a dependency on kerberos-shared.  However,
there is no longer a dep on kerberos-shared, so these classes should
be moved to shared-ldap's 'org.apache.directory.shared.ldap.ldif'
package, to be alongside a bunch of other LDIF code.  These 2 classes
are used by core, namely ServerContextFactory and
StartupConfiguration.

There appears to be a more robust LDIF loader in shared-ldap, but the
one in protocol-shared supports load filters.  They could possibly be
combined at some point.  Or, since we only ever used filters for
Kerberos, someday we could just delete the protocol-shared LDIF
classes and adjust core accordingly.

Can I make the moves in #1 and/or #2?  Comments?

Enrique

Re: [ApacheDS] 2 class files moves

Posted by Ersin Er <er...@gmail.com>.
On 5/30/07, Enrique Rodriguez <en...@gmail.com> wrote:
> Hi, Directory developers,
>
> I'd like to make 2 moves of classes:
>
> 1)  In 'server-unit' I'd like to move AbstractServerTriggerServiceTest
> from src/test/java to src/main/java.  The issue is that the test
> classes don't get packaged into jar artifacts so if you want to use an
> abstract test outside of server-unit you can't.  This is likely why
> AbstractServerTest is is src/main/java.

I was just about to remove that class completely :-) So let me have a
look at it first. BTW, we have this scheme in other places in the
server like:

http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/authz/AbstractAuthorizationITest.java?view=markup

> 2)  In 'protocol-shared' there are 2 classes for loading LDIFs,
> LdifFileLoader and LdifLoadFilter.  I believe these were in
> protocol-shared to address a dependency on kerberos-shared.  However,
> there is no longer a dep on kerberos-shared, so these classes should
> be moved to shared-ldap's 'org.apache.directory.shared.ldap.ldif'
> package, to be alongside a bunch of other LDIF code.  These 2 classes
> are used by core, namely ServerContextFactory and
> StartupConfiguration.
>
> There appears to be a more robust LDIF loader in shared-ldap, but the
> one in protocol-shared supports load filters.  They could possibly be
> combined at some point.  Or, since we only ever used filters for
> Kerberos, someday we could just delete the protocol-shared LDIF
> classes and adjust core accordingly.
>
> Can I make the moves in #1 and/or #2?  Comments?
>
> Enrique
>


-- 
Ersin

Re: [ApacheDS] 2 class files moves

Posted by Alex Karasulu <ak...@apache.org>.
Oh did he delete something you wanted to use or was it something you also
wanted to delete?
Guess it does not matter you guys have the information on how to use this
Maven feature now
so I guess you got what you need.

Alex

On 5/30/07, Enrique Rodriguez <en...@gmail.com> wrote:
>
> On 5/30/07, Alex Karasulu <ak...@apache.org> wrote:
> > ...
> > http://maven.apache.org/guides/mini/guide-attached-tests.html
> >
> > Let's figure out if we can use this before moving around too many
> things.
> > Sounds though what ersin did is ok so long as no deps were messed with.
>
> This looks like the way to go, but, as noted, Ersin deleted the unused
> code in this case.
>
> Enrique
>

Re: [ApacheDS] 2 class files moves

Posted by Enrique Rodriguez <en...@gmail.com>.
On 5/30/07, Alex Karasulu <ak...@apache.org> wrote:
> ...
> http://maven.apache.org/guides/mini/guide-attached-tests.html
>
> Let's figure out if we can use this before moving around too many things.
> Sounds though what ersin did is ok so long as no deps were messed with.

This looks like the way to go, but, as noted, Ersin deleted the unused
code in this case.

Enrique

Re: [ApacheDS] 2 class files moves

Posted by Alex Karasulu <ak...@apache.org>.
Yes you can create test attachments or something like that.  These are jars
of tests that can be reused
by other projects even though your test cases are in src/test directories.

Here's a link:

    http://maven.apache.org/guides/mini/guide-attached-tests.html

Let's figure out if we can use this before moving around too many things.
Sounds though what ersin did is ok so long as no deps were messed with.

Alex

On 5/30/07, David Jencks <da...@yahoo.com> wrote:
>
>
> On May 29, 2007, at 7:41 PM, Enrique Rodriguez wrote:
>
> > Hi, Directory developers,
> >
> > I'd like to make 2 moves of classes:
> >
> > 1)  In 'server-unit' I'd like to move AbstractServerTriggerServiceTest
> > from src/test/java to src/main/java.  The issue is that the test
> > classes don't get packaged into jar artifacts so if you want to use an
> > abstract test outside of server-unit you can't.  This is likely why
> > AbstractServerTest is is src/main/java.
>
> I think it would be much better to have one or more test-support jars
> for these base test classes that can be included as test-scope
> dependencies. There seems to be a way to get maven to put the test
> classes for a project into an auxilliary jar, this seems like the
> most likely cleanest way to proceed:
>
> http://maven.apache.org/plugins/maven-jar-plugin/test-jar-mojo.html
>
> thanks
> david jencks
>
> >
> > 2)  In 'protocol-shared' there are 2 classes for loading LDIFs,
> > LdifFileLoader and LdifLoadFilter.  I believe these were in
> > protocol-shared to address a dependency on kerberos-shared.  However,
> > there is no longer a dep on kerberos-shared, so these classes should
> > be moved to shared-ldap's 'org.apache.directory.shared.ldap.ldif'
> > package, to be alongside a bunch of other LDIF code.  These 2 classes
> > are used by core, namely ServerContextFactory and
> > StartupConfiguration.
> >
> > There appears to be a more robust LDIF loader in shared-ldap, but the
> > one in protocol-shared supports load filters.  They could possibly be
> > combined at some point.  Or, since we only ever used filters for
> > Kerberos, someday we could just delete the protocol-shared LDIF
> > classes and adjust core accordingly.
> >
> > Can I make the moves in #1 and/or #2?  Comments?
> >
> > Enrique
>
>

Re: [ApacheDS] 2 class files moves

Posted by David Jencks <da...@yahoo.com>.
On May 29, 2007, at 7:41 PM, Enrique Rodriguez wrote:

> Hi, Directory developers,
>
> I'd like to make 2 moves of classes:
>
> 1)  In 'server-unit' I'd like to move AbstractServerTriggerServiceTest
> from src/test/java to src/main/java.  The issue is that the test
> classes don't get packaged into jar artifacts so if you want to use an
> abstract test outside of server-unit you can't.  This is likely why
> AbstractServerTest is is src/main/java.

I think it would be much better to have one or more test-support jars  
for these base test classes that can be included as test-scope  
dependencies. There seems to be a way to get maven to put the test  
classes for a project into an auxilliary jar, this seems like the  
most likely cleanest way to proceed:

http://maven.apache.org/plugins/maven-jar-plugin/test-jar-mojo.html

thanks
david jencks

>
> 2)  In 'protocol-shared' there are 2 classes for loading LDIFs,
> LdifFileLoader and LdifLoadFilter.  I believe these were in
> protocol-shared to address a dependency on kerberos-shared.  However,
> there is no longer a dep on kerberos-shared, so these classes should
> be moved to shared-ldap's 'org.apache.directory.shared.ldap.ldif'
> package, to be alongside a bunch of other LDIF code.  These 2 classes
> are used by core, namely ServerContextFactory and
> StartupConfiguration.
>
> There appears to be a more robust LDIF loader in shared-ldap, but the
> one in protocol-shared supports load filters.  They could possibly be
> combined at some point.  Or, since we only ever used filters for
> Kerberos, someday we could just delete the protocol-shared LDIF
> classes and adjust core accordingly.
>
> Can I make the moves in #1 and/or #2?  Comments?
>
> Enrique


Re: [ApacheDS] 2 class files moves

Posted by Enrique Rodriguez <en...@gmail.com>.
On 5/30/07, Emmanuel Lecharny <el...@apache.org> wrote:
> ...
> Whar is LoadFilters?

LoadFilters are like "add" interceptors, but that engage only during
LDIF loading.  For example, we were using a LoadFilter to intercept
additions of Kerberos principal names and to derive and add Kerberos
keys.

Enrique

Re: [ApacheDS] 2 class files moves

Posted by Emmanuel Lecharny <el...@apache.org>.
Enrique Rodriguez a écrit :

> Hi, Directory developers,
>
> I'd like to make 2 moves of classes:
>
> 1)  In 'server-unit' I'd like to move AbstractServerTriggerServiceTest
> from src/test/java to src/main/java.  The issue is that the test
> classes don't get packaged into jar artifacts so if you want to use an
> abstract test outside of server-unit you can't.  This is likely why
> AbstractServerTest is is src/main/java.

I think it's something we should do, unless there are some tricky 
reasons I'm not aware of to keep this class in src/test. I see an 
immediate advantage from this move : users will be able to create their 
own tests using the standard JAR (we have suffered lately from the lack 
of this class when writing the tutorial about embedding ADS in JUNIT tests)

So you have my +1, but I would like ALex to confirm it.

>
> 2)  In 'protocol-shared' there are 2 classes for loading LDIFs,
> LdifFileLoader and LdifLoadFilter.  I believe these were in
> protocol-shared to address a dependency on kerberos-shared.  However,
> there is no longer a dep on kerberos-shared, so these classes should
> be moved to shared-ldap's 'org.apache.directory.shared.ldap.ldif'
> package, to be alongside a bunch of other LDIF code.  These 2 classes
> are used by core, namely ServerContextFactory and
> StartupConfiguration.

If the dependency is away, yes, let's use whatever class does the same 
job in shared/ldap, or add them into shared/ldap. I'm pretty sure there 
are already existing (not checked though).

>
> There appears to be a more robust LDIF loader in shared-ldap, but the
> one in protocol-shared supports load filters.  

Whar is LoadFilters?

> They could possibly be
> combined at some point.

Yes, very true.

> Or, since we only ever used filters for
> Kerberos, someday we could just delete the protocol-shared LDIF
> classes and adjust core accordingly.

I have to double check, but I think we can safely remove those class, 
with or without improvement in shared/ldap

>
> Can I make the moves in #1 and/or #2?  Comments?
>
> Enrique
>