2013-03-21 44 views
4

我想一些幫助運行Java黃瓜「世界你好」例如,在此包中找到: cucumber.examples.java.helloworld.HelloStepdefs黃瓜JVM的Java HelloWorld示例OutOfBoundsException錯誤

想知道我錯過了我的設置?

我不斷收到以下錯誤:

Feature: Hello World Time elapsed: 0 sec <<< ERROR! 
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 
    at java.util.ArrayList.RangeCheck(Unknown Source) 
    at java.util.ArrayList.get(Unknown Source) 
    at gherkin.formatter.PrettyFormatter.indentedLocation(PrettyFormatter.java:142) 
    at gherkin.formatter.PrettyFormatter.printStep(PrettyFormatter.java:255) 
    at gherkin.formatter.PrettyFormatter.match(PrettyFormatter.java:179) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at cucumber.runtime.Utils$1.call(Utils.java:44) 
    at cucumber.runtime.Timeout.timeout(Timeout.java:12) 
    at cucumber.runtime.Utils.invoke(Utils.java:40) 
    at cucumber.runtime.RuntimeOptions$2.invoke(RuntimeOptions.java:138) 
    at $Proxy11.match(Unknown Source) 
    at cucumber.runtime.junit.JUnitReporter.match(JUnitReporter.java:61) 
    at cucumber.runtime.Runtime.runStep(Runtime.java:250) 
    at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:49) 
    at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:43) 
    at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:36) 
    at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:83) 
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63) 
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18) 
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) 
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) 
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) 
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) 
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) 
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309) 
    at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70) 
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:77) 
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37) 
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) 
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) 
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) 
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) 
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) 
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309) 
    at cucumber.api.junit.Cucumber.run(Cucumber.java:82) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) 
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) 
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) 
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:113) 
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) 

回答

6

即使我面臨與1.1.3相同的問題:(剛纔看到這個https://groups.google.com/forum/?fromgroups=#!topic/cukes/rCVf28oK1SI它似乎是一個regre ssion問題。我在POM中更改了版本並將文件構建爲1.1.2,現在工作正常。

+1

謝謝,我也解決了它。 (你是否看到未經測試的測試工具中的諷刺;)) – Ithar 2013-03-22 11:49:11

1

這個錯誤只發生在我配置格式化程序時,刪除它,所有的測試運行正常。

因此,刪除格式化...和版本1.1.3的作品,但你沒有輸出所有?!