use of io.vertigo.dynamo.task.metamodel.TaskDefinition in project vertigo by KleeGroup.
the class TaskManagerTest method testExecuteAdd.
/**
* Checks the use case of an addition with several inputs and an output
*/
@Test
public void testExecuteAdd() {
final TaskDefinition taskDefinition = getTaskDefinition(TaskDefinitionProvider.TK_ADDITION);
Assert.assertEquals(Integer.valueOf(10), executeTask(taskDefinition, 5, 2, 3));
}
use of io.vertigo.dynamo.task.metamodel.TaskDefinition in project vertigo by KleeGroup.
the class TaskManagerTest method testExecuteMulti2.
/**
* Checks the use case of an multiplication with one input and an output
* the input is composed with a List.
*/
@Test
public void testExecuteMulti2() {
final TaskDefinition taskDefinition = getTaskDefinition(TaskDefinitionProvider.TK_MULTIPLICATION_2);
Assert.assertEquals(Integer.valueOf(30), executeTask2(taskDefinition, 5, 2, 3));
}
use of io.vertigo.dynamo.task.metamodel.TaskDefinition in project vertigo by KleeGroup.
the class TaskManagerTest method testExecuteAdd2.
/**
* Checks the use case of an addition with one input and an output
* the input is composed with a List.
*/
@Test
public void testExecuteAdd2() {
final TaskDefinition taskDefinition = getTaskDefinition(TaskDefinitionProvider.TK_ADDITION_2);
Assert.assertEquals(Integer.valueOf(10), executeTask2(taskDefinition, 5, 2, 3));
}
use of io.vertigo.dynamo.task.metamodel.TaskDefinition in project vertigo by KleeGroup.
the class SuperHeroDataBase method execStatement.
private void execStatement(final String request) {
final TaskDefinition taskDefinition = TaskDefinition.builder("TK_INIT").withEngine(TaskEngineProc.class).withRequest(request).build();
final Task task = Task.builder(taskDefinition).build();
taskManager.execute(task);
}
use of io.vertigo.dynamo.task.metamodel.TaskDefinition in project vertigo by KleeGroup.
the class TaskEngineProcBatchTest method testInsertBatchWithAdditionalParam.
/**
* Tests batch insertion with a task
*/
@Test
public void testInsertBatchWithAdditionalParam() {
final String request = new StringBuilder("insert into SUPER_HERO(ID, NAME) values (").append("#").append(DTC_SUPER_HERO_IN + ".ID").append("# , ").append("#").append(OTHER_PARAM_IN).append("# ) ").toString();
final TaskDefinition taskDefinition = TaskDefinition.builder("TK_TEST_INSERT_BATCH").withEngine(TaskEngineProcBatch.class).addInRequired(DTC_SUPER_HERO_IN, getApp().getDefinitionSpace().resolve(DO_DT_SUPER_HERO_DTC, Domain.class)).addInRequired(OTHER_PARAM_IN, getApp().getDefinitionSpace().resolve(DO_STRING, Domain.class)).withRequest(request).build();
final DtList<SuperHero> superHeroes = SuperHeroDataBase.getSuperHeroes();
final Task task = Task.builder(taskDefinition).addValue(DTC_SUPER_HERO_IN, superHeroes).addValue(OTHER_PARAM_IN, "test").build();
try (final VTransactionWritable transaction = transactionManager.createCurrentTransaction()) {
taskManager.execute(task);
transaction.commit();
}
Assert.assertEquals(superHeroes.size(), selectHeroes().size());
}
Aggregations