简体   繁体   English

在IntelliJ中运行scala测试

[英]Running scala tests in IntelliJ

I want to debug a variable in scala metadata.sparkVersion in KMeans.scala using scala test suits in spark KMeansSuite.scala . 我想使用spark KMeansSuite.scala scala测试KMeans.scalaKMeans.scala中的scala metadata.sparkVersion中调试变量。

在此输入图像描述

I have set my break point. 我确定了自己的突破点。 However when I try to run (Or right click) it, I dont see a Run option. 但是,当我尝试运行(或右键单击)它时,我没有看到Run选项。 How do I fix this?. 我该如何解决?。 How should I go about debugging the code. 我该如何调试代码。

在此输入图像描述

Please follow the tutorial . 请按照教程进行操作 You need Scala plugin if you want Idea to undestand ScalaTest. 如果你想要想法取消ScalaTest,你需要Scala插件。 If it is already done: Right click on test folder and "Mark directory as"-> "Test Sources Root". 如果已经完成:右键单击测试文件夹并“将目录标记为” - >“测试源根”。

Alternative is to annotate the test with @RunWith(classOf[JUnitRunner]) see here Then the tests will be executed with JUnit 替代方法是使用@RunWith(classOf [JUnitRunner])注释测试,请参阅此处然后使用JUnit执行测试

Or you can have JUnit tests 或者您可以进行JUnit测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM