use of org.dkpro.lab.engine.impl.DefaultTaskExecutionService in project dkpro-lab by dkpro.
the class MultiThreadBatchTaskTest method setup.
@Before
public void setup() {
File path = new File("target/repository/" + getClass().getSimpleName() + "/" + name.getMethodName());
System.setProperty("DKPRO_HOME", path.getAbsolutePath());
FileUtils.deleteQuietly(path);
// Configure Lab to use MultiThreadBatchTaskEngine
// Use newInstance here to avoid leaking the reconfiguration into other unit tests
Lab lab = Lab.newInstance(Lab.DEFAULT_CONTEXT);
oldEngine = ((DefaultTaskExecutionService) lab.getTaskExecutionService()).getEngine(BatchTask.class);
((DefaultTaskExecutionService) lab.getTaskExecutionService()).registerEngine(BatchTask.class, MultiThreadBatchTaskEngine.class);
lab.setProperty(MultiThreadBatchTaskEngine.PROP_THREADS, "10");
}
use of org.dkpro.lab.engine.impl.DefaultTaskExecutionService in project dkpro-lab by dkpro.
the class MultiThreadBatchTaskTest method teardown.
@After
public void teardown() {
// Restore Lab to using default BatchTask engine
Lab lab = Lab.getInstance();
oldEngine = ((DefaultTaskExecutionService) lab.getTaskExecutionService()).getEngine(BatchTask.class);
((DefaultTaskExecutionService) lab.getTaskExecutionService()).registerEngine(BatchTask.class, oldEngine);
}
Aggregations