use of org.dkpro.lab.Lab in project dkpro-lab by dkpro.
the class ConversionServiceTest method testDiscriminationWithConversionServiceOverride.
@Test
public void testDiscriminationWithConversionServiceOverride() throws Exception {
Integer integer = new Integer(3);
ParameterSpace ps = new ParameterSpace(Dimension.create(KEY, integer));
DefaultBatchTask batch = new DefaultBatchTask();
batch.setParameterSpace(ps);
batch.addTask(consumer);
Lab instance = Lab.newInstance(Lab.DEFAULT_CONTEXT);
// we register an alternative text for the integer value which should be used instead of the
// default of converting the numerical value to string
instance.getConversionService().registerDiscriminable(integer, "three");
instance.run(batch);
assertEquals("three", discriminatorText);
}
Aggregations