簡體   English   中英

如何使用 jupiter Junit5 平台的老式引擎運行帶有類別的 JUnit4 測試的 gradle 配置

[英]How to configure with gradle running JUnit4 tests with categories using vintage engine of jupiter Junit5 platform

當我們只有 JUnit4 測試時,我們使用

test {
    useJUnit{
        excludeCategories "SlowTests"
    }
}

現在遷移到 JUnit5 並且仍然有 JUnit4 測試,我們如何在 JUnitPlattform 中使用它來讓標有 JUnit 測試類別的測試退出?

test {
    useJUnitPlatform{
        // ???
    }
}

JUnit4的類別根據類別的完整類名映射到標簽

所以以下應該工作:

tasks.test {
    useJUnitPlatform {
        includeTags.add("com.acme.Example")
        // or the following to exclude the tag: includeTags.add("!com.acme.Example")
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM