美文网首页Spring
Empty test suite

Empty test suite

作者: 王勇1024 | 来源:发表于2019-01-17 18:49 被阅读3次

背景

新建了一个spring boot项目,但是在进行单元测试时提示“Empty test suite”

alpha.iml

  </component>
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6">
    <output url="file://$MODULE_DIR$/target/classes" />
    <output-test url="file://$MODULE_DIR$/target/test-classes" />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/alpha-interface/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/alpha-exptmgr/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/alpha-exptmgr/src/test/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/alpha-exptmgr/src/test/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/alpha-exptmgr/src/main/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/alpha-demo/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/alpha-demo/src/main/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/alpha-demo/src/test/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/alpha-demo/src/test/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/alpha-interfaces/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/alpha-interfaces/src/main/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/alpha-interfaces/src/test/java" isTestSource="true" />
      <excludeFolder url="file://$MODULE_DIR$/target" />
    </content>
    ······

原因

/alpha-exptmgr/src/test/resources下的代码已经被alpha模块占用

解决方案

删除<content url="file://$MODULE_DIR$">下相关配置即可

相关文章

网友评论

    本文标题:Empty test suite

    本文链接:https://www.haomeiwen.com/subject/eefwdqtx.html