我像这样运行理论测试
@Theory
public void qlIsNotNullAndReservationWithRefIdDoesntHaveItemReference(
@TestedOn(ints = {100, 200, 300}) final int value) {
assertTrue("should be no error", false);
}
它总是会出现 ParameterizedAssertionError 错误而没有任何有意义的消息。
反正有消息显示“正确”失败?
日志:
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ stock ---
[INFO] Compiling 25 source files to /Users/user/repository/reboot/trunk/company-stock/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.14.1:test (default-test) @ stock ---
[INFO] Surefire report directory: /Users/user/repository/reboot/trunk/company-stock/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Picked up _JAVA_OPTIONS: -Xms1024m -Xmx1024m -XX:MaxPermSize=512m
Running de.company.stock.webservice.CornerCaseAnalysisIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.265 sec <<< FAILURE!
test1(de.company.stock.webservice.CornerCaseAnalysisIT) Time elapsed: 0.082 sec <<< ERROR!
org.junit.experimental.theories.internal.ParameterizedAssertionError: test1(ints)
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at de.company.stock.webservice.CornerCaseAnalysisIT.test1(CornerCaseAnalysisIT.java:60)
Results :
Tests in error:
? ParameterizedAssertion test1(ints)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 46.763s
[INFO] Finished at: Thu Feb 20 17:57:56 CET 2014
[INFO] Final Memory: 34M/989M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14.1:test (default-test) on project stock: There are test failures.