【问题标题】:bazel - JUnit4Runner inside bazel could be use with junit `Category`?bazel - bazel 内的 JUnit4Runner 可以与 junit `Category` 一起使用吗?
【发布时间】:2021-12-10 06:37:23
【问题描述】:

Bazel 在 com.google.testing.junit 包中有他们的 JUnit4Runner,它似乎基于 junit4。

我尝试将 Bazel JUnit4Runner 与 Categroy 注释一起使用。但对我不起作用。

1 似乎支持testIncludeFilterRegexp 但不支持junit 的Categroy

Bazel 的 JUnit4Runner 不支持Category 吗? 我不确定。任何帮助将不胜感激。

【问题讨论】:

    标签: bazel-java


    【解决方案1】:

    当使用 Category 构造 TestSuite 时,我不得不使用 @RunWith(Categories::class)

    以下代码对我有用。

    @RunWith(Categories::class)
    @Suite.SuiteClasses(AllTests::class)
    @Categories.IncludeCategory(EnormousTest::class)
    class AllEnormousTests
    
    @RunWith(ClasspathSuite::class)
    class AllTests
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多