directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@apache.org>
Subject ChangeLog, tests and Ldif injection
Date Wed, 11 Feb 2009 10:17:05 GMT
Hi,

I will sumarize here the problem I met while using ChangeLog and Ldif
injection, as the previous mails where a bit confusing, as I wrote
them under fire.

First, let's describe what we want when it comes to tests.

We have three levels in tests :
- method, where we run the real test
- class, gathering a set of tests
- suite, running a set of classes

At each level, we need to inject some data, which will be the data the
tests will use. We may have method scope data, (data used only by a
single test), class scope data and suite scope data. For instance, if
we inject a schema, we may want to do this only at the suite level, as
there are no need to redefine a schema for each method or class.

In any case, the way it will work is describe here :

Start the suite
  start the server
  inject the suite data

  for each class in the suite
    tag[class]
    inject the class data

    for each method in the class
      tag[method]
      inject the method data
      run the test
      revert[method]

    revert[class]

As we can see, we have two places where we can revert data : for each
method, when the test has been run, in order to revert to the class
data, and for each class, as the next class in the suite may use a
different set of data. This results to the following stack of
operations/tags :

injectLdif[suite]
  tag[class]
  injectLdif[class]
    tag[method]
    injectLdif[method]
    revert[method]
    tag[method]
    injectLdif[method]
    revert[method]
    ...
    tag[method]
    injectLdif[method]
    revert[method]
  revert[class]
  tag[class]
  injectLdif[class]
    tag[method]
    injectLdif[method]
    revert[method]
    tag[method]
    injectLdif[method]
    revert[method]
    ...
    tag[method]
    injectLdif[method]
    revert[method]
  revert[class]
  ...
end

Now, what happens when we don't inject data in a class ? The stack is
as follow :

injectLdif[suite]
  tag[class]
    tag[method]
    injectldif[method]
    revert[method]
    tag[method]
    injectldif[method]
    revert[method]
    ...
    tag[method]
    injectldif[method]
    revert[method]
  revert[class]
  tag[class]
    tag[method]
    injectldif[method]
    revert[method]
    tag[method]
    injectldif[method]
    revert[method]
    ...
    tag[method]
    injectldif[method]
    revert[method]
  revert[class]
  ...
end

We have two tags set, one for the class, immediately followed by
another tag for the method. As we didn't injected data in betwee, only
one tag will be set in this case, as the current tag implementation
checks if a tag for a specific revision has already been set.

This is where I'm having a problem. And this is what i'm trying to
solve, but I think that using the 'description' field in the Tag
object could help : we just have to tell the ChangeLog system to
revert back to the specified description instead of a specific
revision, and it will work.
-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.iktek.com

Mime
View raw message