Skip to content

Commit

Permalink
[Core] Upgrade datatable to 1.1.3
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 06ced5a
Author: M.P. Korstanje <rien.korstanje@gmail.com>
Date:   Fri Jul 27 13:50:14 2018 +0200

    Upgrade datatable to 1.1.3

commit 8dfbd90
Author: lukasz.suski <szakal783@wp.pl>
Date:   Fri Jul 6 17:10:29 2018 +0200

    Add ability to register default transformers for table cell and entry
  • Loading branch information
lsuski authored and mpkorstanje committed Jul 27, 2018
1 parent f840358 commit 1b9020c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
* [Weld] Document the need for a beans.xml per source root ([#923](https://github.com/cucumber/cucumber-jvm/pull/923) Harald Albers)

### Changed
* [Core] Upgrade datatable to 1.1.3 ([#1414](https://github.com/cucumber/cucumber-jvm/pull/1414) Łukasz Suski)
* [Core] Upgrade cucumber expressions to 6.0.0 ([#1377](https://github.com/cucumber/cucumber-jvm/pull/1377) Aslak Hellesøy)
* Throw an error if a parameter type is used inside optional text parenthesis, or with alternative text.
* Bugfix for nested capture groups.
Expand Down
22 changes: 17 additions & 5 deletions core/src/main/java/cucumber/api/TypeRegistry.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
package cucumber.api;

import io.cucumber.cucumberexpressions.ParameterType;
import io.cucumber.cucumberexpressions.ParameterTypeRegistry;
import io.cucumber.datatable.DataTableType;
import io.cucumber.datatable.DataTableTypeRegistry;

import java.lang.reflect.Type;
import java.util.Locale;
import io.cucumber.datatable.TableCellByTypeTransformer;
import io.cucumber.datatable.TableEntryByTypeTransformer;

public interface TypeRegistry {

void defineParameterType(ParameterType<?> parameterType);

void defineDataTableType(DataTableType tableType);

/**
* Set default transformer for entries which are not defined by
* {@code defineDataTableType(new DataTableType(Class<T>,TableEntryTransformer<T>))}
*
* @param tableEntryByTypeTransformer default transformer
*/
void setDefaultDataTableEntryTransformer(TableEntryByTypeTransformer tableEntryByTypeTransformer);

/**
* Set default transformer for cells which are not defined by
* {@code defineDataTableType(new DataTableType(Class<T>,TableEntryTransformer<T>))}
*
* @param tableCellByTypeTransformer default transformer
*/
void setDefaultDataTableCellTransformer(TableCellByTypeTransformer tableCellByTypeTransformer);
}
11 changes: 11 additions & 0 deletions core/src/main/java/io/cucumber/stepexpression/TypeRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import io.cucumber.cucumberexpressions.ParameterTypeRegistry;
import io.cucumber.datatable.DataTableType;
import io.cucumber.datatable.DataTableTypeRegistry;
import io.cucumber.datatable.DefaultDataTableEntryTransformer;
import io.cucumber.datatable.TableCellByTypeTransformer;

import java.util.Locale;

Expand Down Expand Up @@ -35,4 +37,13 @@ public void defineDataTableType(DataTableType tableType) {
dataTableTypeRegistry.defineDataTableType(tableType);
}

@Override
public void setDefaultDataTableEntryTransformer(DefaultDataTableEntryTransformer defaultDataTableEntryTransformer) {
dataTableTypeRegistry.setDefaultDataTableEntryTransformer(defaultDataTableEntryTransformer);
}

@Override
public void setDefaultDataTableCellTransformer(TableCellByTypeTransformer defaultDataTableCellTransformer) {
dataTableTypeRegistry.setDefaultDataTableCellTransformer(defaultDataTableCellTransformer);
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<tag-expressions.version>1.1.1</tag-expressions.version>
<typetools.version>0.5.0</typetools.version>
<cucumber-expressions.version>6.0.0</cucumber-expressions.version>
<datatable.version>1.0.3</datatable.version>
<datatable.version>1.1.3</datatable.version>
</properties>
<licenses>
<license>
Expand Down

0 comments on commit 1b9020c

Please sign in to comment.