You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Alex Karasulu <ak...@apache.org> on 2007/10/06 07:23:29 UTC

Issues with tests

Enrique,

There were a slew of copy and paste problems that I had to fix all the tests
created recently:

  * Sasl tests
  * NTP test
  * Kerberos interceptor based tests

Furthermore they don't seem to follow the pattern of using the
AbstractTestCase and AbstractServerTestCase
classes.  It would help a lot if you tried to use these instead of
duplicating the setUp() code.   Eventually
switching to the FastXXXITest that Emmanuel setup should be the best.

I'm not going to go into the Sasl mechanism but there are copy and paste
issues there as well.  Regardless
the BindHandler that was copied and pasted had several issues anyway.  I
know it was not the best model
to follow.  We need to seriously rework the LdapProtocolProvider.  It's got
major issues in general besides the
SASL chain based mechanism which should be removed IMO.

Thanks,
Alex

Re: Issues with tests

Posted by Alex Karasulu <ak...@apache.org>.
On 10/6/07, Enrique Rodriguez <en...@gmail.com> wrote:
>
> IIRC, the base classes you mention cannot currently be reused for the
> non-LDAP protocol providers.  The setUp() method in question does not
> allow modification to the configuration prior to the startup of the
> server.  Once the server is started up, there is no way to dynamically
> reconfigure.  Thus the "cut & paste" code you see is simply the
> minimum boilerplate for starting a server instance when custom config
> is required.


Yes this makes sense.  You're right about it.  Hopefully we can get to a
better situation
for all the protocols across the board.

It was just a pain having to refactor each one of these tests whereas the
other tests fell
in line with a fix to the AbstractTestCase.

Perhaps as the tests are migrated to the FastXXXITest test we can
> figure out to allow subclasses to make these changes in a clean
> manner.


That would be really nice especially with your involvement.  As witnessed by
this refactoring, tests
really save us.  Without them in place refactoring like this would have not
been possible.  So let's
do it right for all the protocols with these new FastXXXITests once and for
all.

Alex

Re: Issues with tests

Posted by Enrique Rodriguez <en...@gmail.com>.
On 10/5/07, Alex Karasulu <ak...@apache.org> wrote:
> There were a slew of copy and paste problems that I had to fix all the tests
> created recently:
> ...

Thanks for doing this.  The clean-up has been much needed.

> ...
> Furthermore they don't seem to follow the pattern of using the
> AbstractTestCase and AbstractServerTestCase
> classes.  It would help a lot if you tried to use these instead of
> duplicating the setUp() code.   Eventually
> switching to the FastXXXITest that Emmanuel setup should be the best.
> ...

IIRC, the base classes you mention cannot currently be reused for the
non-LDAP protocol providers.  The setUp() method in question does not
allow modification to the configuration prior to the startup of the
server.  Once the server is started up, there is no way to dynamically
reconfigure.  Thus the "cut & paste" code you see is simply the
minimum boilerplate for starting a server instance when custom config
is required.

The non-LDAP protocol providers must make changes to the:
1)  enabled protocols (all PP besides LDAP are disabled by default)
2)  enabled schema (eg Kerberos)
3)  enabled interceptors (eg key derivation interceptor)
4)  advanced tests (multi-realm) may require additional partitions.

In short, the test base classes are highly LDAP-centric.  This
includes the SASL GSSAPI test, which uses Kerberos.

Perhaps as the tests are migrated to the FastXXXITest test we can
figure out to allow subclasses to make these changes in a clean
manner.  Could be as simple as some template methods called by the
setUp() method.

Enrique