Vladimir Egorov wrote:
Stefan, thanks for your reply. Yes, printing the build file makes things
clear for an isolated run. But if you want to compare runs across
various systems, you need a fully-qualified test name that does not
depend on the system. The absolute path to build file depends on the
system.
In JUnit, the fully-qualified class name does not depend on the system.
As AntUnit does great job so far mapping JUnit to Ant, it would be nice
to have a mapping for the fully-qualified class name. Since Ant does not
have a concept of classpath or package, one approach is using relative
path to the build file, rather then absolute path.
Say, my AntUnit file (the one that has test targets) is located at
/local/path/to/antunittests/samples/Test.au.xml
I am running AntUnit on it using
<antunit>
<fileset dir="/local/path/to/antunittests/">
<include name="**/*.au.xml"/>
</fileset>
</antunit>
Then my build file is named "samples/Test.au.xml". This name does not
depend on the system.
While the above does not depend on the system. If the user rearranges
directory structure the name of the tests change. While this is ok for
most of the users. In teams that have test repository (to see history of
test and trend over time), having an explicit name is important.
Thus, the above can be the default, as it's simple and work for most
people. AntUnit should consider providing an attribute which make naming
a combination of project and target name. Here's an example
<antunit explicitnaming="true">
<fileset dir="/local/path/to/antunittests/">
<include name="**/*.au.xml"/>
</fileset>
</antunit>
In a test file, we will have
<project name="tomcat.webapp">
<target name="testPost">
</project>
In above, the fully qualified name of the test will be
tomcat.webapp.testPost
--Vishal
Vladimir
P.S. I don't see any problem with separating (relative path to) build
file and target name.
-----Original Message-----
From: Stefan Bodewig [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 22, 2006 9:16 PM
To: user@ant.apache.org
Subject: Re: AntUnit tests need fully-qualified names
On Wed, 22 Feb 2006, Vladimir Egorov <[EMAIL PROTECTED]> wrote:
The plainlistener that comes with AntUnit uses test target names as
results names.
The plainlistener is more or less just a proof of concept. When I put
it together I needed someting to quickly show to myself that AntUnit
really did what it was supposed to.
Since two or more build files can define target named testFoo, this
can lead to naming conflicts.
It does print the build file prior to listing the targets, doesn't it?
Although one can write a custom AntUnit listener, it would be nice
to standardize on the "fully-qualified" test target naming. Is there
any plan or discussion of this?
None yet.
The current implementation matches what Ant does in the JUnit case, we
separate between test class name and test name, both in the plain text
and the XML listeners. Given that we don't have any XML listener in
AntUnit yet, I'd expect us to list build file and target there as
well.
How would you want to create the fully qualified name (what would it
look like)? Why do you think it would be better than separating the
information on build file and target?
Cheers
Stefan
[Vladimir]
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.