maven-surefire-plugin

How to get Maven to use my TestNG XML file?

柔情痞子 提交于 2019-12-11 02:54:12
问题 **FIRST: I have read literally every post in here on how to do this, I am following all instructions to the letter including those from Maven itself. I have converted an Eclipse Selenium project using TestNG over to a Maven project. I cannot get Maven to run my tests from the Test.XML file instead of running in the default mode where it just picks up anything with the word "Test" in the file name... I can execute the test.xml directly and everything works, so I think I got the conversion

maven-surefire-plugin ignores plugins order in pom.xml

≡放荡痞女 提交于 2019-12-10 18:54:43
问题 I have multimodule maven project. This project contains self written maven plugin and test project for this plugin. I want to run my plugin in test phase before maven-surefire-plugin I put maven-surefire-plugin after my plugin in pom.xml <build> <plugins> <plugin> <groupId>com.my.group</groupId> <artifactId>validator-maven-plugin</artifactId> <version>${project.version}</version> <executions> <execution> <phase>test</phase> <goals> <goal>validate</goal> </goals> </execution> </executions> <

How do I load different logback configuration for Maven/Surefire and Eclipse

╄→гoц情女王★ 提交于 2019-12-10 15:55:12
问题 I want to have different default logback configurations for my unit tests in Eclipse and Maven (surefire plugin). Basically, I want any logs generated during tests to be sent to the console in Eclipse or to a file for Maven. Currently, I have a single logback-test.xml that has both appenders. I think the solution involves adding a different logback-test.xml for the two classpaths. But how do I do that? Having something manual in maven is likely ok (in a profile for example), but requiring a

How can I switch between two test suites in Maven 2?

半腔热情 提交于 2019-12-10 15:48:59
问题 We're using the maven-surefire-plugin to run our Java tests. The tests fall into two categories: Fast tests Slow tests The whole "fast" suite runs in a couple of seconds while the slow tests take half an hour. During development, I want to run only the fast tests. When I commit, I'd like to be able to run the slow tests as well, so running the slow tests should be an option while the fast tests should be the default. On the CI server, I want to run both. It's OK (and even preferred) when the

maven test report format

谁都会走 提交于 2019-12-10 15:06:21
问题 When I run the tests In my Java/Groovy Maven project, the test reports are stored in target/surefire-reports . For each test class that is run a .txt and .xml file is created showing the output of that class. All in all, this is a remarkably unhelpful format, as it doesn't provide any easy way to quickly see which tests failed and the output they produced. I'd like something similar to Grails' test reports. Is there are any easy way to change the report format to something more user friendly?

How to import working directory for JUnit from maven to IDEA

ぃ、小莉子 提交于 2019-12-10 14:07:29
问题 I am trying to make new developers of my maven project to have as easy start as possible. I am using and recommending IntelliJ IDEA as an IDE for them. I am pretty satisfied with the results of importing the maven project to IDEA. The only complication that I have now is importing of the working directory from the surefire plugin. In my pom.xml I have the following: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.7.2</version>

GitLab CI is failing due to maven-surefire-plugin with VM crash

谁说我不能喝 提交于 2019-12-10 04:24:47
问题 We have around of 10 different applications that are Spring Boot projects with Groovy. All of our projects build correctly in all developer work stations and they were running correctly until yesterday, however suddenly all of them stopped working today only in our GitLab CI pipelines with below error: [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ----------------------

How to run junit suite in parallel using maven surefire plugin

时光毁灭记忆、已成空白 提交于 2019-12-10 00:08:34
问题 I have a testsuite say JunitTest1 and JunitTest2 as below, @RunWith(Suite.class) @SuiteClasses({ com.sample.test1.class, com.sample.test2.class, com.sample.test3.class, }) public class JunitTest1 { } @RunWith(Suite.class) @SuiteClasses({ com.sample.xxx1.class, com.sample.xxx2.class, com.sample.xxx3.class, }) public class JunitTest2 { } I want to run both the testsuite in parallel but the test class inside the testsuite should run in the specified order. I have added the below plugin in maven

jacoco coverage per test setup

自古美人都是妖i 提交于 2019-12-09 21:37:32
问题 I'm using jacoco in order to gather code metrics and import them to sonarQube but i was missing details about coverage per test. So after searching about it i came to this tutorial but failed to make it work on my project. here is my pom.xml <properties> <sonarVersion>2.4</sonarVersion> <spring-framework.version>4.0.0.RELEASE</spring-framework.version> <spring-framework.security.version>3.2.5.RELEASE</spring-framework.security.version> <jackson.version>1.9.13</jackson.version> <jacoco.version