ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/util PackageNameMapperTest.java
Date Sun, 30 Dec 2001 00:32:34 GMT
This is my first real addition to Ant as a committer, so I thought I would
send a message about it and see what others thought (as it can easily be
removed if its problematic for some reason).

I was attempting to write a way to short circuit unit tests if they had
already been done and are up-to-date, and one of the things that needs to be
done (and certainly not the only thing) is to check the results files
against the Java test case.  Like this:

          <mapper classname="org.apache.tools.ant.util.PackageNameMapper"
                  from="*Test.java" to="${test.data.dir}/TEST-*Test.xml"/>

This works very nicely within an <uptodate> inside a <condition> (I'll leave
the other conditions as an exercise to the reader!).

What it does is replace pieces of the path (whatever matches the "*") from
strings like "org/apache/tools/ant/util/PackageNameMapper" with
"org.apache.tools.ant.util.PackageNameMapper".

It may only be useful for <junit> / XML formatter type files, but it seems
handy enough to be possibly useful in some other situations.

Let me know if you think I should make it an official mapper type, and I'll
gladly do that and document it along with the other mappers.  How about the
name "package" as the mapper type?

    Erik


----- Original Message -----
From: <ehatcher@apache.org>
To: <jakarta-ant-cvs@apache.org>
Sent: Saturday, December 29, 2001 7:17 PM
Subject: cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/util
PackageNameMapperTest.java


> ehatcher    01/12/29 16:17:04
>
>   Added:       src/main/org/apache/tools/ant/util PackageNameMapper.java
>                src/testcases/org/apache/tools/ant/util
>                         PackageNameMapperTest.java
>   Log:
>   A new mapper to allow checking <uptodate> from test cases to their XML
formatter results.



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message