You can do it without ant-contrib:

      <pathconvert property="non-matched-files" setonempty="false">
          <path>
              <fileset dir="${dir}">
                  <include name="**/*.class"/>
                  <exclude name="**/*Test.class"/>
                  <present targetdir="${dir}" present="srconly">
<mapper type="glob" from="*.class" to="*Test.class"/>
                  </present>
              </fileset>
          </path>
      </pathconvert>
      <fail if="non-matched-files"/>

Juergen Hermann wrote:

On Fri, 22 Jul 2005 03:40:36 +0200, Danilo Buerger wrote:

is it possible to make sure that for each class a corresponding unit test class exist? For example:

For these two classes:

/xyz/main.class
/xyz/whatever.class

define this as a fileset, use a <mapper> to map to the test files, iterate over it using antcontrib:for and finally use <available> and <fail unless=> in the for loop body. ain't it easy?

or better, use something like Clover which does a much more stronger check than "a file exists which looks like a test case".

Ciao, Jürgen



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





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

Reply via email to