ScalaTest plugin with mixed Java-Scala, multi-module project

52 views
Skip to first unread message

Java Jim

unread,
Mar 28, 2017, 10:28:39 AM3/28/17
to scalatest-users
Good Morning,

I'm working on a multi-module Maven project that has an established suite of JUnit tests executed using the SureFire plugin.  The Scala codebase in this project is growing, and with it, the number of Scala unit tests. Someone on my team has added the ScalaTest plugin to the parent POM as a managed plugin and left the SureFire plugin (also managed) unchanged.  It appears both the JUnit and Scala unit tests all run, though we can't get any coverage metrics for the Scala tests (though I'm not concerned about that right now).

I have a concern with this configuration.  The ScalaTest user guide seems very clear when it says, "To use the ScalaTest Maven plugin, you need to disable SureFire and enable ScalaTest."  My co-worker feels this is more a suggestion or an option, while I read that sentence as a requirement. 

Could someone clarify this point for us?  My concern is that it's a happy coincidence the JUnit tests are running, not because it's a supported feature of the ScalaTest plugin, and that we'll have to revisit this configuration in the future.

Thanks!

Jim Kaib

Bill Venners

unread,
Mar 28, 2017, 11:02:21 AM3/28/17
to scalate...@googlegroups.com
Hi,

Sorry for the delay in approving. I didn't notice a notification of this post. If you want to mix both ScalaTest and JUnit tests you may want to use Surefire and annotate the ScalaTest tests with RunWith annotations, as shown here:


That said, I do not recall why we suggested to turn off Surefire, but probably because they conflicted. That was many years ago, so if they don't conflict now, which is what you seem to be describing, then I'd just go with that.

Bill

--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalatest-users@googlegroups.com
To unsubscribe from this group, send email to
scalatest-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest
---
You received this message because you are subscribed to the Google Groups "scalatest-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalatest-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Bill Venners
Artima, Inc.
http://www.artima.com
Reply all
Reply to author
Forward
0 new messages