use of org.knime.core.data.convert.util.SerializeUtil.FactoryPlaceholder in project knime-core by knime.
the class SerializeUtilTest method testPlaceholders.
@Test
public void testPlaceholders() throws InvalidSettingsException {
final NodeSettings testSettings = new NodeSettings(getClass().getName());
final DefinitelyNotRegisteredFactory theMissingFactory = new DefinitelyNotRegisteredFactory();
SerializeUtil.storeConverterFactory(theMissingFactory, testSettings, "missing-factory");
Optional<DataCellToJavaConverterFactory<?, ?>> missingFactory = SerializeUtil.loadDataCellToJavaConverterFactory(testSettings, "missing-factory");
assertFalse(missingFactory.isPresent());
final FactoryPlaceholder placeholder = SerializeUtil.getPlaceholder(testSettings, "missing-factory");
assertEquals(theMissingFactory.getName(), placeholder.getName());
assertEquals(theMissingFactory.getSourceType().getName(), placeholder.getSourceTypeName());
assertEquals(theMissingFactory.getDestinationType().getName(), placeholder.getDestinationTypeName());
assertEquals(theMissingFactory.getIdentifier(), placeholder.getIdentifier());
}
Aggregations