1
我正在使用scala编写一些测试到java maven项目。我想用maven插件运行这些测试,但我还希望剩下的JUnit测试也能运行。 问题是,根据this guidelines我必须禁用surefire。 我有一个运行scalatest和junit测试的解决方案吗?如何使用Maven插件运行JUnit测试的Scalatest
我正在使用scala编写一些测试到java maven项目。我想用maven插件运行这些测试,但我还希望剩下的JUnit测试也能运行。 问题是,根据this guidelines我必须禁用surefire。 我有一个运行scalatest和junit测试的解决方案吗?如何使用Maven插件运行JUnit测试的Scalatest
你可以使用maven surefire插件运行你的scalatests。您只需指定通过注释使用JUnitRunner
即可运行您的scalatest。
@RunWith(classOf[JUnitRunner])
class MyTest extends FunSuite with Matchers {
test("foobar") {
true should be(true)
}
}
你知道如何配置scalatest在这种情况下运行?例如确保有记者或配置标签? –