maven-surefire-plugin

How to run TestNG suite with failsafe without unpacking dependency jar?

喜欢而已 提交于 2019-12-21 21:32:58
问题 I'd like to execute integration tests using a TestNG suite file which is contained in a dependency jar. The details of setting up the pom.xml are discussed here Here's the pom file I currently have. The problem is with the part where I need to define a suite file: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven

How to get Jenkins to --fail-fast on Maven 2 builds?

别等时光非礼了梦想. 提交于 2019-12-21 20:33:11
问题 I am trying to build a multi-module Maven project using Jenkins. When I build the same project on the command-line using the same environment (variables/settings.xml/user) as Jenkins does, test failures cause the build to fail immediately: Failed tests: testSomething(com.package_name.TestSomethingOrTheOther) Tests run: .., Failures: 1, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ----------------------------

Maven won't run tests

折月煮酒 提交于 2019-12-20 20:03:36
问题 When running mvn test maven won't run all Test Classes. When I explicitly provide a class by adding -Dtest=PropertyTests the tests will be run. Here's my pom.xml: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>example<

Maven won't run tests

倾然丶 夕夏残阳落幕 提交于 2019-12-20 20:03:14
问题 When running mvn test maven won't run all Test Classes. When I explicitly provide a class by adding -Dtest=PropertyTests the tests will be run. Here's my pom.xml: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>example<

Maven surefire and JDK 11

我怕爱的太早我们不能终老 提交于 2019-12-20 16:16:07
问题 I'm trying to get Maven surefire to run under JDK 11 but I keep getting these errors: If I set reuseForks to true: Error occurred in starting fork, check output in log Process Exit Code: 1 at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:670) at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:283) at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:246) If I set it to false: Execution default-test

Maven surefire and JDK 11

旧时模样 提交于 2019-12-20 16:14:13
问题 I'm trying to get Maven surefire to run under JDK 11 but I keep getting these errors: If I set reuseForks to true: Error occurred in starting fork, check output in log Process Exit Code: 1 at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:670) at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:283) at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:246) If I set it to false: Execution default-test

Is there a way to update default-bindings.xml for maven on local

坚强是说给别人听的谎言 提交于 2019-12-20 04:17:05
问题 It could sound dumb. But is there a way to edit or update the default-bindings file of maven? /META-INF/plexus/default-bindings.xml Why would I want to do that? Background - I am using latest maven version 3.3.9 on my machine as a home directory within intelliJ. I have a module named testng-test without any external plugin specified. Take a look at the pom.xml for the module : <artifactId>testng</artifactId> <dependencies> <dependency> <groupId>org.testng</groupId> <artifactId>testng<

How to us Maven PDF Plugin to generate PDF from Surefire Report?

不羁的心 提交于 2019-12-19 03:58:12
问题 after running my JUnit tests I use the Maven Surefire Report plugin (http://maven.apache.org/plugins/maven-surefire-report-plugin/) to generate a HTML test report. This results in the following file: ./target/site/surefire-report.html I know that there is a Maven PDF plugin to generate PDF files (http://maven.apache.org/plugins/maven-pdf-plugin/surefire-report.html). But I don't manage to get it working. I included it in my pom.xml: <plugin> <groupId>org.apache.maven.plugins</groupId>

Where should I put interface class for Junit @Category?

China☆狼群 提交于 2019-12-18 23:47:18
问题 I'd like to define project-wide interfaces, to be used in @Category annotations, and configure Maven to exclude their annotated tests when building the whole project. In the application project there's a test I'd like to categorize: @Category(Integration.class) @Test public void testExternalResource() { ... } The setting: I've set up a multi-module maven project: /container (has a pom with <modules> element) /parent (all other modules inherit from its pom. has no source, only pom) /util

How to parametrize Maven surefire plugin so I can choose which TestNG suites to run

[亡魂溺海] 提交于 2019-12-18 10:44:54
问题 I've got many test suites in TestNG. These are XML files. I want to be able to choose multiple XML suites when running integration-test from maven. Currently I can add the suite files to pom.xml like this: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <suiteXmlFiles> <suiteXmlFile>${pathToMySuiteFile_1}</suiteXmlFile> <suiteXmlFile>${pathToMySuiteFile_1}</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> This