DataTableTypeRegistry { DataTableType lookupTableTypeByType(Type type) { return lookupTableTypeByType(type, Function.identity()); } DataTableTypeRegistry(Locale locale); void defineDataTableType(DataTableType dataTableType); void setDefaultDataTableEntryTransformer(TableEntryByTypeTransformer defaultDataTableEntryTransformer); void setDefaultDataTableCellTransformer(TableCellByTypeTransformer defaultDataTableCellTransformer);  }
@Test void null_short_transformed_to_null() { DataTableTypeRegistry registry = new DataTableTypeRegistry(Locale.ENGLISH); DataTableType dataTableType = registry.lookupTableTypeByType(LIST_OF_LIST_OF_SHORT); assertEquals( singletonList(singletonList(null)), dataTableType.transform(singletonList(singletonList(null))) ); }
@Test void null_integer_transformed_to_null() { DataTableTypeRegistry registry = new DataTableTypeRegistry(Locale.ENGLISH); DataTableType dataTableType = registry.lookupTableTypeByType(LIST_OF_LIST_OF_INTEGER); assertEquals( singletonList(singletonList(null)), dataTableType.transform(singletonList(singletonList(null))) ); }
@Test void null_long_transformed_to_null() { DataTableTypeRegistry registry = new DataTableTypeRegistry(Locale.ENGLISH); DataTableType dataTableType = registry.lookupTableTypeByType(LIST_OF_LIST_OF_LONG); assertEquals( singletonList(singletonList(null)), dataTableType.transform(singletonList(singletonList(null))) ); }
@Test void null_float_transformed_to_null() { DataTableTypeRegistry registry = new DataTableTypeRegistry(Locale.ENGLISH); DataTableType dataTableType = registry.lookupTableTypeByType(LIST_OF_LIST_OF_FLOAT); assertEquals( singletonList(singletonList(null)), dataTableType.transform(singletonList(singletonList(null))) ); }
@Test void null_double_transformed_to_null() { DataTableTypeRegistry registry = new DataTableTypeRegistry(Locale.ENGLISH); DataTableType dataTableType = registry.lookupTableTypeByType(LIST_OF_LIST_OF_DOUBLE); assertEquals( singletonList(singletonList(null)), dataTableType.transform(singletonList(singletonList(null))) ); }
@Test void null_string_transformed_to_null() { DataTableTypeRegistry registry = new DataTableTypeRegistry(Locale.ENGLISH); DataTableType dataTableType = registry.lookupTableTypeByType(LIST_OF_LIST_OF_STRING); assertEquals( singletonList(singletonList(null)), dataTableType.transform(singletonList(singletonList(null))) ); }
@Test void parse_decimal_with_english_locale() { DataTableTypeRegistry registry = new DataTableTypeRegistry(Locale.ENGLISH); DataTableType dataTableType = registry.lookupTableTypeByType(LIST_OF_LIST_OF_BIG_DECIMAL); assertEquals( singletonList(singletonList(new BigDecimal("2105.88"))), dataTableType.transform(singletonList(singletonList("2,105.88"))) ); }
@Test void parse_decimal_with_german_locale() { DataTableTypeRegistry registry = new DataTableTypeRegistry(Locale.GERMAN); DataTableType dataTableType = registry.lookupTableTypeByType(LIST_OF_LIST_OF_BIG_DECIMAL); assertEquals( singletonList(singletonList(new BigDecimal("2105.88"))), dataTableType.transform(singletonList(singletonList("2.105,88"))) ); }
@Test void null_big_integer_transformed_to_null() { DataTableTypeRegistry registry = new DataTableTypeRegistry(Locale.ENGLISH); DataTableType dataTableType = registry.lookupTableTypeByType(LIST_OF_LIST_OF_BIG_INTEGER); assertEquals( singletonList(singletonList(null)), dataTableType.transform(singletonList(singletonList(null))) ); }
@Test void null_big_decimal_transformed_to_null() { DataTableTypeRegistry registry = new DataTableTypeRegistry(Locale.ENGLISH); DataTableType dataTableType = registry.lookupTableTypeByType(LIST_OF_LIST_OF_BIG_DECIMAL); assertEquals( singletonList(singletonList(null)), dataTableType.transform(singletonList(singletonList(null))) ); }
@Test void null_byte_transformed_to_null() { DataTableTypeRegistry registry = new DataTableTypeRegistry(Locale.ENGLISH); DataTableType dataTableType = registry.lookupTableTypeByType(LIST_OF_LIST_OF_BYTE); assertEquals( singletonList(singletonList(null)), dataTableType.transform(singletonList(singletonList(null))) ); }