Matt Benson wrote:
> The AntUnit documentation says:
>
> "Each test target is run in a fresh Ant project; i.e.
> each test target has a fresh set of properties and
> references." But if I have test targets:
>
> <target name="testFoo">
> <property name="foo" value="foo" />
> <au:assertTrue message="$${foo}=${foo}">
> <equals arg1="${foo}" arg2="foo" />
> </au:assertTrue>
> </target>
>
> <target name="testBar">
> <property name="foo" value="bar" />
> <au:assertTrue message="$${foo}=${foo}">
> <equals arg1="${foo}" arg2="bar" />
> </au:assertTrue>
> </target>
>
> one will fail, as I would expect given that the
> AntUnit code uses a single Project instance to run all
> targets.
>
> The fun part: if we change the behavior to suit the
> documentation, the utility of beforeTests/afterTests
> is pretty much reduced to filesystem artifacts. I
> would choose to correct the documentation to describe
> the actual behavior, and see if we can't get scoped
> properties working (minus the memory leaks) for Ant
> 1.7.1-1.8 , to alleviate the discomfort of having to
> choose new properties for every test (see the apply
> testcase in core).
>
> Thoughts?
Every test run should be in its own project.
if you want setup before a test, you can depend on setup targets, and we
already do a teardown at the end of each run
If you want before/after targets, why not modify <au:antunit> to let you
declare the name of the before/after targets to run?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
|