0
我在寫一個定製的Gradle插件,它將創建一個新的測試任務並運行它。我需要在這個測試任務上設置一些配置。如何在用Java編寫的自定義插件中配置Gradle TestNGOptions?
插件是用Java編寫和執行測試任務的代碼如下所示:
private void runSmokeTests() {
Test test = new Test();
test.useTestNG(new Closure(/* What goes in here? */) {
// and here? How do I get hold of TestNGOptions?
});
test.executeTests();
}
我無法弄清楚如何使用封閉類從Java。
完美。謝謝馬克。 –