Questions tagged [surefire]

The Surefire Maven Plugin is used during the test phase of the build lifecycle to execute the unit tests of an application. It is commonly used in continuous integration.

The Surefire Plugin is used during the test phase of the build lifecycle to execute the unit tests of an application. It generates reports in two different file formats:

Plain text files (.txt)
XML files (
.xml)

By default, these files are generated at ${basedir}/target/surefire-reports.

The Surefire Plugin has only one goal:

surefire:test

runs the unit tests of an application.

Related tags :

278 questions
7
votes
4 answers

How to get the icons for the resulted maven-surefire-report-plugin

I'm using maven-surefire-report-plugin in order to generate the unit tests report. This is working fine however the report contains links to images which are not presented. How can I make maven copy the icons required for the report? Should I use…
Nava Polak Onik
  • 1,509
  • 2
  • 13
  • 17
7
votes
1 answer

Run a single plug-in test method using tycho-surefire-plugin

How can I run a single plug-in test method in Maven using tycho-surefire-plugin? I tried the -Dtest option with #, but it doesn't work: mvn clean install -Dtest=MyUITest#testDummy Is there something I am missing?
7
votes
1 answer

How to generate JUnit style XML report using TestNG?

I'm using TestNG framework for our integration testing. I want to generate JUnit style XML report using TestNG. My project does not use Ant but we use Maven. Can you please tell what is the format of JUnit style XML looks like and how to generate…
Anand Garlapati
  • 107
  • 1
  • 1
  • 5
6
votes
2 answers

How to only run unit tests once when running "maven clean install" and Sonar?

I had the following configuration for my Jenkins job: First clean and build the maven project, then run the unit tests and static analysis: clean install sonar:sonar The problem was that install and sonar:sonar each ran the unit tests which…
Robber
  • 419
  • 1
  • 4
  • 15
6
votes
3 answers

Running all tests from a @Category using Maven

I want to run only a subset of my unit tests, the ones defined by a specific @Category. So I read several SO questions, such as this one (which is exactly what I am looking for), and also this one. The solution of my problem seems to be provided by…
Romain Linsolas
  • 79,475
  • 49
  • 202
  • 273
6
votes
4 answers

surefire HeapDumpOnOutOfMemoryError

When running my unit tests in Maven on windows i'm getting an OutOfMemory exception. I tried to add -XX:-HeapDumpOnOutOfMemoryError option to the surefire argLine, but no dump file is generated. I also tried to add the same thing to MAVEN_OPTS, but…
Koby
  • 605
  • 5
  • 11
6
votes
2 answers

Where can i find the DTD or XML Schema of surefire generated XML (TEST-.xml) file?

Where can i find the DTD or XML Schema of surefire generated XML (TEST-.xml) file?
Sudhir
  • 523
  • 2
  • 6
  • 15
6
votes
3 answers

Maven - Selenium - Possible to run only one test

We are using JUnit - Selenium for our web tests. We use Maven to start them and build a surefire report. The test suite is pretty large and takes a while to run and sometimes single tests fail because the browser won't start. I want to be able run a…
Jonas Söderström
  • 4,856
  • 2
  • 36
  • 45
6
votes
1 answer

Retrieve standard output of successful tests in surefire?

Maven Surefire records standard output and error output for every failed tests which can be later found in generated files in surefire-reports directory. The output of tests which pass with no error is however discarded. Is it possible to set up…
Hynek
  • 61
  • 1
  • 2
6
votes
1 answer

Test coverage for both Powermock and JMockit unit tests

Has anyone been able to get unit test coverage of both JMockit and Powermock unit tests working in JaCoCo from Maven build? I have an existing test set of Powermock unit tests, that I would like to gradually migrate to JMockit. But I need to be…
Justin Rowe
  • 2,356
  • 1
  • 20
  • 15
6
votes
2 answers

"Skipping execution of surefire because it has already been run for this configuration"?

Please excuse the newb question - my conceptual models are still quite incomplete... I'm trying to re-execute TestNG tests from a command line using maven and surefire. My command line looks like: D:\workspaces\workspace01\aptest>mvn clean install…
6
votes
2 answers

How to present unit test graph in Jenkins email report?

I am using Jenkins to execute our unit tests and send emails to developers. I am using Jelly Script to include the pass/fail results in the email. However, I would also like to include the pass/fail graph that surefire reports presents to you after…
user1340582
  • 19,151
  • 35
  • 115
  • 171
6
votes
1 answer

Exception with surefire plugin with test phase in maven

I need to use surefire v2.12, but I get the attached stack trace every time I run that version. If I run v2.10 I do not get the error. I need this version so I can annotate my test classes with @Category and label them as either UnitTests or…
bclarance
  • 159
  • 1
  • 2
  • 5
5
votes
2 answers

Stop Tests on first Failure with Maven/JUnit/Spring

I'd like Maven to stop trying to run my JUnit Spring tests when it encounters the first error. Is this possible? My test classes look like the following, and I run them just as a standard Maven target. @ContextConfiguration(locations =…
DeejUK
  • 12,891
  • 19
  • 89
  • 169
5
votes
1 answer

Does Maven Surefire execute test cases sequentially by default?

This is a follow up to this question which I realized when I dug deeper into my research: Is it reasonable to suppose that the Maven Surefire plugin executes test cases sequentially by default: a test case ends befores the next one starts (I'm not…
H-H
  • 4,431
  • 6
  • 33
  • 41