use of cz.metacentrum.perun.engine.scheduling.impl.ExecutorEngineWorkerImpl in project perun by CESNET.
the class TaskExecutorEngineImplTest method execute.
@Override
public void execute(Runnable arg0) {
// for test there is no send subfolder, let's fake root
((ExecutorEngineWorkerImpl) arg0).setSendDirectory(new File("/"));
arg0.run();
}
use of cz.metacentrum.perun.engine.scheduling.impl.ExecutorEngineWorkerImpl in project perun by CESNET.
the class ExecutorEngineWorkerImplTest method runGenTest.
@Test
public void runGenTest() throws Exception {
System.out.println("ExecutorEngineWorkerImpl.runGenTest");
ExecutorEngineWorker worker = (ExecutorEngineWorker) beanFactory.getBean("executorEngineWorker");
log.debug("task " + task_gen.toString());
schedulingPool.addToPool(task_gen);
for (Task task : taskManager.listAllTasks(engineId)) {
log.debug("task in db " + ((task == null) ? "null" : task.toString()));
}
count = 0;
// for test there is no send subfolder, let's fake root
((ExecutorEngineWorkerImpl) worker).setGenDirectory(new File("/"));
worker.setTask(task_gen);
worker.setExecService(task_gen.getExecService());
worker.setFacility(task_gen.getFacility());
worker.setDestination(destination1);
worker.setResultListener(this);
worker.run();
Assert.isTrue(count == 1, "count 1");
}
use of cz.metacentrum.perun.engine.scheduling.impl.ExecutorEngineWorkerImpl in project perun by CESNET.
the class ExecutorEngineWorkerImplTest method runSendTest.
@Test
public void runSendTest() throws Exception {
System.out.println("ExecutorEngineWorkerImpl.runSendTest");
ExecutorEngineWorker worker = (ExecutorEngineWorker) beanFactory.getBean("executorEngineWorker");
log.debug("task " + task1.toString());
// add task to local db
schedulingPool.addToPool(task1);
for (Task task : taskManager.listAllTasks(engineId)) {
log.debug("task in db " + ((task == null) ? "null" : task.toString()));
}
count = 0;
// for test there is no send subfolder, let's fake root
((ExecutorEngineWorkerImpl) worker).setSendDirectory(new File("/"));
worker.setTask(task1);
worker.setExecService(task1.getExecService());
worker.setFacility(task1.getFacility());
worker.setDestination(destination1);
worker.setResultListener(this);
worker.run();
Assert.isTrue(count == 1, "count 1");
}
Aggregations