Search in sources :

Example 6 with Lab

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);
}
Also used : ParameterSpace(org.dkpro.lab.task.ParameterSpace) Lab(org.dkpro.lab.Lab) DefaultBatchTask(org.dkpro.lab.task.impl.DefaultBatchTask) Test(org.junit.Test)

Aggregations

Lab (org.dkpro.lab.Lab)6 DefaultBatchTask (org.dkpro.lab.task.impl.DefaultBatchTask)4 Test (org.junit.Test)3 DefaultTaskExecutionService (org.dkpro.lab.engine.impl.DefaultTaskExecutionService)2 ParameterSpace (org.dkpro.lab.task.ParameterSpace)2 File (java.io.File)1 After (org.junit.After)1 Before (org.junit.Before)1