I am learning Scala and would like to set up integrated unit testing in Eclipse. As far as I can tell from googling, ScalaTest is the way to go, possibly in combination with JUnit.
What are your experiences with unit testing Scala in Eclipse? Should I use the JUnit runner or something else?
There is a wiki page on the ScalaIDE website on how to run Scala unit tests in Eclipse. If you have specific issues with running specs unit tests, I encourage you to post messages on the specs-users mailing list.
Eric.
I was unable to run the ScalaTest specs with JUnit runner inside eclipse. I think this is because of the absence of the @Test
annotated methods. However if your project has Maven support, you can run your specs from command line using mvn test
. For Surefire plugin to detect your specs, use the following configuration in your pom file.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<includes>
<include>**/*Spec.class</include>
</includes>
</configuration>
</plugin>
Check out these example for reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With