Questions tagged «maven-surefire-plugin»

19
Maven surefire无法找到ForkedBooter类
最近进入一个新项目,我正在尝试编译我们的源代码。昨天一切正常,但是今天又是另一个故事了。 每次我在mvn clean install模块上运行时,一旦通过测试,就会崩溃为错误: [INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ recorder --- [INFO] Surefire report directory: /lhome/code/recorder/target/surefire-reports [INFO] Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider [INFO] parallel='none', perCoreThreadCount=true, threadCount=0, useUnlimitedThreads=false, threadCountSuites=0, threadCountClasses=0, threadCountMethods=0, parallelOptimized=true ------------------------------------------------------- T E S T S ------------------------------------------------------- Error: Could not find or load main class org.apache.maven.surefire.booter.ForkedBooter Results : Tests run: …

30
分叉的VM终止了,没有说再见。VM崩溃或System.exit被调用
请帮我解决这个问题。我不完全了解日志中的错误是什么意思。 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 21.749s [INFO] Finished at: Thu Apr 24 10:10:20 IST 2014 [INFO] Final Memory: 15M/37M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test (default-test) on project samples.simpleforwarding: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test failed: The forked VM terminated without saying properly …


7
防止单元测试,但允许在Maven中进行集成测试
我有一个Maven构建,其中使用SureFire插件运行一些单元测试,使用FailSafe插件运行一些集成测试。我想要一种只运行FailSafe插件的测试的方法。 对于我而言,在pom中添加不同的配置文件或其他内容不是一个好的解决方案,因为它是多模块构建,并且我不想编辑每个模块的pom。 有skip.tests和maven.test.skip和skipTests它停止所有的测试,并且skipITs,其中只有故障安全插件停止。 那么,是否为Maven提供了一个命令行标记,例如skipITs,而是具有“ onlyIT”功能?


13
Surefire没有接受Junit 5测试
我用JUnit 5编写了一个简单的测试方法: public class SimlpeTest { @Test @DisplayName("Some description") void methodName() { // Testing logic for subject under test } } 但是当我跑步时mvn test,我得到了: ------------------------------------------------------- T E S T S ------------------------------------------------------- Running SimlpeTest Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec Results : Tests run: 0, …

5
运行单元测试时出现IntelliJ错误:无法找到或加载主类$ {surefireArgLine}
在IntelliJ中运行单元测试时,出现以下错误:错误:找不到或加载主类$ {surefireArgLine}。我正在使用maven,在pom.xml中,我有: <properties> ... <surefire.argLine /> </properties> <build> <plugins> <plugin> <groupId>com.mysema.maven</groupId> <artifactId>apt-maven-plugin</artifactId> <version>1.1.1</version> <executions> <execution> <goals> <goal>process</goal> </goals> <configuration> <outputDirectory>target/generated-sources/java</outputDirectory> <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.17</version> <configuration> <!--Sets the VM argument line used when unit tests are run.--> <argLine>${surefire.argLine}</argLine> </configuration> </plugin> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.7.1.201405082137</version> <executions> <!-- …

8
如何在Maven中按类别运行JUnit测试?
使用JUnit 4.8和新的@Category注释,是否可以选择类别的子集以与Maven的Surefire插件一起运行? 例如,我有: @Test public void a() { } @Category(SlowTests.class) @Test public void b() { } 我想按如下方式运行所有非慢速测试:(请注意,-Dtest.categories由我组成...)。 mvn test -Dtest.categories=!SlowTests // run non-slow tests mvn test -Dtest.categories=SlowTests // run only slow tests mvn test -Dtest.categories=SlowTests,FastTests // run only slow tests and fast tests mvn test // run all tests, including …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.