Re: replace surefire with ant task

2006-11-22 Thread Dave Syer

While I agree with Chris Hilton that there is a smell with tests that run in
ant but not surefire, surefire clearly isn't all it might be in other areas
(e.g. http://jira.codehaus.org/browse/SUREFIRE-52).  If anyone has a nice
ant plugin recipe for running junit tests in m2 I'd be interested in seeing
it.
-- 
View this message in context: 
http://www.nabble.com/replace-surefire-with-ant-task-tf2568859s177.html#a7500827
Sent from the Maven - Users mailing list archive at Nabble.com.


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



RE: replace surefire with ant task

2006-11-03 Thread Chris Hilton
Some thoughts:

1. You might try experimenting with the forkMode setting for Surefire.
Ant's junit task defaults to perTest, but the default for Surefire is
once. Poorly written tests sometimes rely on the perTest behavior,
but well-written tests should be able to run with once (IMHO). For
that matter, Surefire isn't really doing anything particularly special
as a unit test runner, so if certain tests won't run, that smells.

2. Here's a plugin configuration we use to generate old junitreport HTML
files for a data gathering tool we still have to support:

  plugin  
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-antrun-plugin/artifactId
executions
  execution
idjunitreport/id
phasetest/phase
configuration
  tasks
junitreport todir=target/surefire-reports
  fileset dir=target/surefire-reports
include name=TEST-*.xml /
  /fileset
  report todir=target/surefire-reports /
/junitreport  
  /tasks
/configuration
goals
  goalrun/goal
/goals
  /execution
/executions
dependencies
  dependency
groupIdant/groupId
artifactIdant-junit/artifactId
version1.6.2/version
  /dependency
/dependencies
  /plugin

This relies on the surefire plugin running the tests and finding the xml
test results in the surefire-reports directly. You should be able to
insert your own Ant junit task (and configure Surefire to skip tests),
if necessary, and modify the rest appropriately.

Chris

 -Original Message-
 From: Sommers, Elizabeth [mailto:[EMAIL PROTECTED] 
 Sent: Friday, 03 November, 2006 10:17
 To: Maven Users List (E-mail)
 Subject: replace surefire with ant task
 
 
 I want to replace the surefire tests with the ant junit 
 tests.  I also want to run ant junitreport instead of the 
 surefire report.  Does anybody have a way to do this?  Many 
 of our tests won't run under surefire, others fail when they 
 shouldn't. Excluding tests is not an option.
 
 Thanks
 Liz Sommers
 [EMAIL PROTECTED]
 
 

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