use of org.knime.core.data.DataTypeRegistry in project knime-core by knime.
the class ValueSchemaTest method testSchemaSaveLoadRegisteredDataTypes.
/**
* Test saving and loading a schema with all registered DataTypes
*/
@Test
public void testSchemaSaveLoadRegisteredDataTypes() {
final DataTypeRegistry registry = DataTypeRegistry.getInstance();
final Collection<DataType> dataTypes = registry.availableDataTypes();
for (final DataType type : dataTypes) {
final Optional<Class<? extends ValueFactory<?, ?>>> optFactoryClass = registry.getValueFactoryFor(type);
final Class<? extends ValueFactory<?, ?>> factoryClass = optFactoryClass.isPresent() ? optFactoryClass.get() : DictEncodedDataCellValueFactory.class;
try {
testSchemaSaveLoadDataType(type, factoryClass);
} catch (final Exception e) {
// Add information about the DataType which failed.
throw new AssertionError("The ValueFactory could not be saved and loaded for the DataType '" + type + "' with the cell class '" + type.getCellClass() + "'.", e);
}
}
}
Aggregations