You are viewing a plain text version of this content. The canonical link for it is here.
Posted to surefire-users@maven.apache.org by "Kriegelstein, Thomas" <th...@salt-solutions.de> on 2009/10/21 12:02:01 UTC

Using apache ant inside a surefire test

Hi there,

 

I didn't  find a solution or even suggestion online to the following
issue I'm having. I've developed a small ant-Task and build it with
maven2. The ant task is supposed to throw a BuildException under certain
circumstances. To test the task, I've created two junit tests, which
invoke ant's Launcher during their test methods. One invocation is
expected to pass, one is expected to fail and produce the
BuildException.

 

Within the test method, I've surrounded the invocation to the Launchers
run method with try and catch, the Exception still propagates to
surrounding surefire plugin and causes the maven2 build to fail.

 

What should I do, to prevent the surefire plugin from seeing the
BuildException thrown by the ant task?

 

Greetings,

  Thomas