Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Friendlier message when XStream fails conversion #296

Closed
aslakhellesoy opened this Issue · 0 comments

1 participant

@aslakhellesoy
cucumber.runtime.xstream.converters.ConversionException: Couldn't convert "2012-03-01" to an instance of: [class java.util.Date]
---- Debugging information ----
class               : java.util.Date
required-type       : java.util.Date
converter-type      : cucumber.runtime.converters.SingleValueConverterWrapperExt
wrapped-converter   : cucumber.runtime.converters.DateConverter
path                : /list/cfd.ProcessSteps$TestMove/time
class[1]            : cfd.ProcessSteps$TestMove
converter-type[1]   : cucumber.runtime.xstream.converters.reflection.ReflectionConverter
class[2]            : java.util.ArrayList
converter-type[2]   : cucumber.runtime.xstream.converters.collections.CollectionConverter
version             : null
-------------------------------
    at cucumber.runtime.converters.ConverterWithFormat.fromString(ConverterWithFormat.java:31)
    at cucumber.runtime.xstream.converters.SingleValueConverterWrapper.fromString(SingleValueConverterWrapper.java:41)
    at cucumber.runtime.xstream.converters.SingleValueConverterWrapper.unmarshal(SingleValueConverterWrapper.java:49)
    at cucumber.runtime.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at cucumber.runtime.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at cucumber.runtime.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at cucumber.runtime.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:355)
    at cucumber.runtime.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:306)
    at cucumber.runtime.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:234)
    at cucumber.runtime.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at cucumber.runtime.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at cucumber.runtime.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at cucumber.runtime.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at cucumber.runtime.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
    at cucumber.runtime.xstream.converters.collections.CollectionConverter.addCurrentElementToCollection(CollectionConverter.java:79)
    at cucumber.runtime.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:72)
    at cucumber.runtime.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:66)
    at cucumber.runtime.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:61)
    at cucumber.runtime.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at cucumber.runtime.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at cucumber.runtime.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at cucumber.runtime.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at cucumber.runtime.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
    at cucumber.runtime.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
    at cucumber.runtime.xstream.XStream.unmarshal(XStream.java:1052)
    at cucumber.runtime.xstream.XStream.unmarshal(XStream.java:1024)
    at cucumber.table.TableConverter.toList(TableConverter.java:48)
    at cucumber.table.DataTable.asList(DataTable.java:33)
    at cucumber.runtime.StepDefinitionMatch.tableArgument(StepDefinitionMatch.java:141)
    at cucumber.runtime.StepDefinitionMatch.transformedArgs(StepDefinitionMatch.java:109)
    at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:43)
    at cucumber.runtime.Runtime.runStep(Runtime.java:223)
    at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
    at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
    at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:36)
    at cucumber.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:76)
    at cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:65)
    at cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:20)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at cucumber.junit.FeatureRunner.run(FeatureRunner.java:72)
    at cucumber.junit.Cucumber.runChild(Cucumber.java:75)
    at cucumber.junit.Cucumber.runChild(Cucumber.java:36)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at cucumber.junit.Cucumber.run(Cucumber.java:80)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:182)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
    at ✽.When the following moves occur:(cfd/diagram.feature:11)

It would be better if the trace just contained the feature3 and the stepdef location:

Failed to convert ..... to ......
    at my.StepDef.myMethod(StepDef.java:39)
    at ✽.When the following moves occur:(cfd/diagram.feature:11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.