![](/img/trans.png)
[英]java.lang.NoClassDefFoundError with Cucumber-JVM Project
[英]Cucumber-jvm Either the specified parameters do not match any of the following constructors: [private java.lang.Class()];
我正在Android上測試一個簡單的Cucumber BDD測試,並遇到了黃瓜錯誤
org.picocontainer.PicoCompositionException: Either the specified
parameters do not match any of the following constructors: [private
java.lang.Class()]; OR the constructors were not accessible for
'java.lang.Class'
我無法弄清楚這個錯誤是從哪里來的。 我想念什么嗎?
我的功能文件
Scenario Outline: Test scenario
Given I have a TestActivity
Then I should see <text> on the display
Examples:
| text |
| 123 |
| test |
步驟定義
@CucumberOptions(features = "features", format = "pretty")
public class TestActivitySteps extends ActivityInstrumentationTestCase2<TestActivity> {
public TestActivitySteps(Class<TestActivity> activityClass) {
super(activityClass);
}
@Given("^I have a TestActivity$")
public void I_have_a_TestActivity() {
assertNotNull(getActivity());
}
@Then("^I should see (\\S+) on the display$")
public void I_should_see_s_on_the_display(final String s) {
onView(withText(s)).check(matches(isDisplayed()));
}
}
注意:
我想通了。 此構造函數正在觸發錯誤。
public TestActivitySteps(Class<TestActivity> activityClass) {
super(activityClass);
}
我更改為后,錯誤消失了
public TestActivitySteps(TestActivity activityClass) {
super(activityClass);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.