DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41940>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41940


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From [EMAIL PROTECTED]  2007-04-25 01:15 -------
I had a look and modified BFT (rev 532247):

    protected void tearDown() throws Exception {
        if (project == null) {
            /*
             * Maybe the BuildFileTest was subclassed and there is
             * no initialized project. So we could avoid getting a
             * NPE.
             * If there is an initialized project getTargets() does
             * not return null as it is initialized by an empty
             * HashSet.
             */
            return;
        }
        final String tearDown = "tearDown";
        if (project.getTargets().containsKey(tearDown)) {
            project.executeTarget(tearDown);
        }
    }


I modified your example

public class MyAntTestClass extends org.apache.tools.ant.BuildFileTest {
    public void testBaseline() {
          junit.framework.Assert.assertTrue(true);
    }
    
    public static void main(String[] args) {
        junit.textui.TestRunner.run(MyAntTestClass.class);
    }
}

<project default="junit">

    <path id="cp">
        <fileset dir="c:/seu/junit3.8.2/junit3.8.2" includes="*.jar" />
        <fileset dir="${ant.home}/lib" includes="*.jar" />
        <pathelement path="." />
    </path>

    <javac srcdir="." destdir="." classpathref="cp" />

    <target name="junit">
        <junit>
            <test name="MyAntTestClass" />
            <classpath refid="cp" />
        </junit>
    </target>

    <target name="run">
        <java classname="MyAntTestClass">
            <classpath refid="cp" />
        </java>
    </target>

</project>

When using "run" (the JUnit Text-TestRunner) that works. When using "junit"
(Ant's JUnitTestRunner) the test fails ...


Could you have a look?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to