Search in sources :

Example 1 with ParameterInfo

use of cucumber.runtime.ParameterInfo in project cucumber-jvm by cucumber.

the class GosuStepDefinition method getParameterInfos.

private List<ParameterInfo> getParameterInfos() {
    IType[] parameterTypes = block.getFunctionType().getParameterTypes();
    List<ParameterInfo> result = new ArrayList<ParameterInfo>(parameterTypes.length);
    for (IType parameterType : parameterTypes) {
        // TODO: Can we get more info from the parameterType?
        result.add(new ParameterInfo(String.class, null, null, null));
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) ParameterInfo(cucumber.runtime.ParameterInfo) IType(gw.lang.reflect.IType)

Example 2 with ParameterInfo

use of cucumber.runtime.ParameterInfo in project cucumber-jvm by cucumber.

the class DataTable method create.

private static DataTable create(List<?> raw, Locale locale, String format, String... columnNames) {
    ParameterInfo parameterInfo = new ParameterInfo(null, format, null, null);
    TableConverter tableConverter = new TableConverter(new LocalizedXStreams(Thread.currentThread().getContextClassLoader()).get(locale), parameterInfo);
    return tableConverter.toTable(raw, columnNames);
}
Also used : TableConverter(cucumber.runtime.table.TableConverter) ParameterInfo(cucumber.runtime.ParameterInfo) LocalizedXStreams(cucumber.runtime.xstream.LocalizedXStreams)

Example 3 with ParameterInfo

use of cucumber.runtime.ParameterInfo in project cucumber-jvm by cucumber.

the class ToDataTableTest method createTableConverterWithDateFormat.

@Before
public void createTableConverterWithDateFormat() {
    LocalizedXStreams.LocalizedXStream xStream = new LocalizedXStreams(Thread.currentThread().getContextClassLoader()).get(Locale.US);
    tc = new TableConverter(xStream, new ParameterInfo(null, DD_MM_YYYY, null, null));
}
Also used : ParameterInfo(cucumber.runtime.ParameterInfo) LocalizedXStreams(cucumber.runtime.xstream.LocalizedXStreams) Before(org.junit.Before)

Aggregations

ParameterInfo (cucumber.runtime.ParameterInfo)3 LocalizedXStreams (cucumber.runtime.xstream.LocalizedXStreams)2 TableConverter (cucumber.runtime.table.TableConverter)1 IType (gw.lang.reflect.IType)1 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1