Petar Tahchiev wrote:
Sorry for the formating :-(.


Hi guys,

it's Petar Tahchiev from the Jakarta Cactus Team (again :-)).
I am trying to integrate the CactusTask with Ant 1.8-alpha.
The CactusTask does:
0) Extends the JUnitTask from Ant.
1) Gets all the tests from JUnitTask
2) Iterates over them and sets different properties to each one of them.
3) Calls the JUnitTask to executes the test-cases.

So, the basis is that we are no longer able to use

execute(org.apache.tools.ant.taskdefs.optional.junit.JUnitTest);

because the delegate field (Object of type JUnitTaskMirror) leaves
uninitialized and thus the CactusTask throws NLPE.
This way to execute the tests we are bound to use the execute() method of
the
JUnitTask (because in that method the delegate object gets initialized).
When calling
the execute() method we have to have our tests configured. But when I get
the tests and configure them with:
===============================================================
                Enumeration tests = getIndividualTests();
while (tests.hasMoreElements())
                {
                    JUnitTest test = (JUnitTest) tests.nextElement();
if (test.shouldRun(getProject())
                     && !theWrapper.isExcluded(test.getName()))
                    {
                        test.setFork(true);
                        if (theWrapper.getToDir() != null)
                        {
                            test.setTodir(theWrapper.getToDir());
                        }
===============================================================

I am no longer able to set them in the JUnitTask. The field tests is
private:

    private Vector tests = new Vector();

and there is no setter for an individual test, or a vector of tests.

Please, can you look serious to this and supply a setter method for this.
This way I can configure
the tests and set them in the JUnitTask, and after that just call execute().


So all you want is a setTests(Vector) method? or an addTest(JUnitTest) method that adds a new test?


--
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to