maven-surefire-plugin

Seemingly Random Test Failure With Maven & Spring Boot 2 When A WebFluxTest Is Introduced

流过昼夜 提交于 2019-12-25 02:26:41
问题 Environment OSX 10.13.5 Java 10.0.1 2018-04-17 Apache Maven 3.5.2 Spring Boot 2.0.3.RELEASE Maven Surefire plugin 2.22.0 Issue I have a test which reliably passes: public class TransformerTest { private final MyTransformer transformer = new MyTransformerImpl(); @Rule public final OutputCapture outputCapture = new OutputCapture(); @Test public void successShouldLogSuccessMessages() { final B result = transformer.transform(new A()); outputCapture.expect(containsString("First message"));

How to permanently exclude one test class in a Maven build

白昼怎懂夜的黑 提交于 2019-12-24 08:46:39
问题 I'm trying to exclude a single test from my maven build (I don't want the test to be compiled or executed). The following doesn't work: <project ...> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <excludes> <exclude>**/MyTest.java</exclude> </excludes> </configuration> </plugin> </plugins> </build> </project> What is the correct way to achieve my goal? I know that I can use the command-line option -Dmaven

Surefire report generating duplicate result in the report

本小妞迷上赌 提交于 2019-12-24 00:27:57
问题 I am following the SO link of MAVEN with ANT Task for SOAPUI automation run with jenkins. It works fine and executes. But Surefire html report generating same testSuite, testCases twice. ANT JUnit Report generates right report Below is my pom.xml file - <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-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>

Error running maven surefire test plugin Java 11

与世无争的帅哥 提交于 2019-12-23 20:55:05
问题 I am running some tests for Spring Boot app in Team City using the maven surefire plugin version 2.22.1. Spring Boot version is 2.1.2. I have specified in the configuration to use a forked Java 11 jvm as follows: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <forkCount>1</forkCount> <jvm>${jdk11.home}/bin/java</jvm> <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine> </configuration> </plugin> When running Team City I get the

maven surefire test plugin runs tests even if they are excluded:

孤街醉人 提交于 2019-12-23 15:42:40
问题 i exclude all tests in plugin except my test suite: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.11</version> <configuration> <!-- <testFailureIgnore>true</testFailureIgnore> <skipTests>true</skipTests> --> <parallel>both</parallel> <threadCount>10</threadCount> <forkMode>once</forkMode> <configuration> <excludes> <exclude>**/Test*.java</exclude> <exclude>**/*Test.java</exclude> <exclude>**/*TestCase.java</exclude> </excludes>

How can I run integration tests after building all modules in a multi-module Maven project?

一世执手 提交于 2019-12-23 12:24:21
问题 I am working on a large multi-module Maven project. Each module has fast unit tests (using the Surefire plugin), many modules have slow integration tests (using the Failsafe plugin). I would like to speed up the feedback for "simple" build failures (compilation errors and unit test failures) by running integration tests from all modules after all modules have been built and unit-tested. Can you suggest a good way of achieving this? 回答1: running integration tests from all modules after all

Surefire:test goal not picking tests

北战南征 提交于 2019-12-23 03:30:33
问题 With Maven, when I run the ‘test’ goal, tests are processed. When I run the ‘surefire:test’ goal, tests are not processed. However, I’ve mentioned the surefire plugin this way in pom.xml: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.0</version> <configuration> <suiteXmlFiles> <suiteXmlFile>foo.xmlxml</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> Can you explain this behaviour? 来源: https://stackoverflow.com

How to pass parameters to guicified TestNG test from Surefire Maven plugin?

瘦欲@ 提交于 2019-12-23 02:57:25
问题 I'm using Maven + Surefire + TestNG + Guice (latest stable ones) I have "large" test that requires Guice to run. Basically I'm doing it this way: @Test(groups = "large") @Guice(modules = FooLargeTest.Module.class) public class FooLargeTest { public static class Module extends AbstractModule { public void configure() { bindConstant().annotatedWith(FooPort.class).to(5000); // ... some other test bindings } } @Inject Provider<Foo> fooProvider; @Test public void testFoo() { Foo foo = fooProvider

Parallel Test run with cucumber

放肆的年华 提交于 2019-12-22 13:11:18
问题 I am currently trying to achieve parallel test run with cucumber. I managed to run two different runners at the same time with the sure-fire plugin. Now I want to check whether is it possible to run SingleRunner file multiple times in parallel. Ex: I have SignUpRunnerTest.java so I need to run this against few platforms parally.Is it possible? This is my Runner file import cucumber.api.CucumberOptions; import cucumber.api.cli.Main; import cucumber.api.junit.Cucumber; import java.util.List;

Problem running tests with enabled preview features in surefire and failsafe

℡╲_俬逩灬. 提交于 2019-12-22 04:14:11
问题 I'm trying to migrate a project to Java 12, with --enable-preview . I added --enable-preview in compiler settings: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> <configuration> <release>12</release> <compilerArgs> <arg>--enable-preview</arg> </compilerArgs> </configuration> </plugin> And also added it in argLine for surefire and failsafe: <properties> <argLine>--enable-preview</argLine> </properties> And do a mvn clean verify results in: [ERROR] Failed to