I wrote a project, which I use testng to test it. It can be built successfully.
When I open this project in Intellij, and switch to each single unit test file. All the test can be passed.
But when I was trying to run “gradle test --info” in the command line, all the unit tests failed.
I don’t why they can pass in the intellij, but failed in command line. I was trying to check the error message. There is nothing special here. Just some message said that the test failed because the assert statement.
Could someone tell me how to fix this? Pretty weird.
> Task :parseq-lambda-names:testClasses Skipping task ':parseq-lambda-names:testClasses' as it has no actions. :parseq-lambda-names:testClasses (Thread[Task worker for ':',5,main]) completed. Took 0.0 secs. :parseq-lambda-names:test (Thread[Task worker for ':',5,main]) started. Gradle Test Executor 19 started executing tests. Gradle Test Executor 19 finished executing tests. > Task :parseq-lambda-names:test FAILED Task ':parseq-lambda-names:test' is not up-to-date because: Task has failed previously. Starting process 'Gradle Test Executor 19'. Working directory: /Users/jguan/Desktop/fixbug/parseq_trunk/parseq/subprojects/parseq-lambda-names Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dorg.gradle.native=false -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp /Users/jguan/.gradle/caches/4.8/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 19' Successfully started process 'Gradle Test Executor 19' Gradle suite > Gradle test > com.linkedin.parseq.lambda.TestInterface.testAbstractFunctionInvocationOnInterface FAILED java.lang.AssertionError: expected [true] but found [false] at org.testng.Assert.fail(Assert.java:94) at org.testng.Assert.failNotEquals(Assert.java:496) at org.testng.Assert.assertTrue(Assert.java:42) at org.testng.Assert.assertTrue(Assert.java:52) at com.linkedin.parseq.lambda.TestInterface.testAbstractFunctionInvocationOnInterface(TestInterface.java:87)