directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Re: [ApacheDS] Separating base unittest classes (Was: Re: svn commit: r307398)
Date Wed, 12 Oct 2005 16:54:59 GMT
2005/10/13, Alex Karasulu <aok123@bellsouth.net>:
>
> Trustin Lee wrote:
>
> > 2005/10/12, Alex Karasulu <aok123@bellsouth.net
> > <mailto:aok123@bellsouth.net>>:
> >
> > Trustin Lee wrote:
> >
> > > The essential problem in our project is that our tests are not unit
> > > tests. If we're doing unit tests, we don't need to start up the
> > whole
> > > ApacheDS everytime we test each classes. But we're doing so by
> > some
> > > reason and the tests takes too much time. Ideally we should change
> > > all of them to unit tests strictly speaking.
> >
> > You're right these are more *integration* tests and not simple unit
> > tests. Again correctness is not always the most sensible approach in
> > our present not so perfect situation :).
> >
> > It's very hard to unit test these interceptors properly though because
> > many presume access to the core. I see how you performed unit
> > tests on
> > the ACI code but I think this was a special case. Without a
> > harness you
> > cannot really test an interceptor.
> >
> >
> > Once we implement in-memory DirectoryPartition (formerly
> > ContextPArtition) implementation, then we can implement mock
> > NextInterceptor very easily which is the hardest part. Nothing is
> > different in this case.
> >
> > So what you're suggesting is we move these tests to an apacheds test
> > project? Hmmm ... That would mean we don't have to create the extra
> > maven projects since there would be no dep in core and in main for
> > these
> > abstract testcases. I like the sound of this, but it raises some
> > concerns for me. I kind of like the fact that nothing deploys unless
> > those tests pass even though it takes a long time for them to run.
> >
> >
> > Yes. But this doesn't necessarily mean that we have to run integration
> > test for *every* test case just like now. We can create a single
> > integration test that tries to launch ApacheDS with full set of
> > interceptors and to test basic LDAP operations. If the core still has
> > some issues, then it's a bug of our test code primarily so I cannot
> > believe the integration test helps us to test individual interceptors.
>
> I don't know what you're talking about now. Sorry I'm lost.


What I'm pointing out are two:

1) We can write unit test for most interceptors and if we can't, it means
we've got some design problem which means that our code is tightly coupled
to each other that leads to the integration which hinders unit testing.

2) For now all interceptor tests are integration tests, so it takes more
than a minute to run whole tests. We don't have to do this only if we have
proper unit tests.

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Mime
View raw message