Using eclipse: 'Run As -> JUnit Tests' runs as expected, showing 1 failed test in the JUnit tab.
However: 'Run As -> Maven test' (or 'Run As -> Maven install') does not. My java test class (PropertyTests extends ClojureTest) is picked up, but no tests are found:
Running myproject.PropertyTests
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.828 sec
Results :
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
Some code, see below. I tried with and without filter, both giving the same results.
Why are the tests not picked up with maven, although they are when running the tests in eclipse with 'Run As -> JUnit Tests'?
public class PropertyTests extends ClojureTest {
/** {@inheritDoc} */
@Override
public String filter() {
return "myproject";
}
}
(ns myproject.gentest
(:require [clojure.test :refer :all])
(deftest fixme
(testing "FIXME, I fail."
(is (= 1 0))))
<depencendies>
[...]
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>1.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.mikera</groupId>
<artifactId>cljunit</artifactId>
<version>0.4.0</version>
<scope>test</scope>
</dependency>
[...]
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/clojure</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>