|
|
|
@ -26,7 +26,7 @@ import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public class DefaultExecutorTest extends ScopedTest {
|
|
|
|
@ -110,8 +110,9 @@ public class DefaultExecutorTest extends ScopedTest {
|
|
|
|
|
inputs.put("Hello", "World");
|
|
|
|
|
long sleepTime = 20000; // 1000 millisec * 20 = 20 sec
|
|
|
|
|
inputs.put(HelloWorldPlugin.SLEEP_TIME, sleepTime);
|
|
|
|
|
int minuteinterval = 2;
|
|
|
|
|
// Every 5 minutes, for 12 times (one hour totally).
|
|
|
|
|
Scheduling scheduling = new Scheduling(60*5,12,true);
|
|
|
|
|
Scheduling scheduling = new Scheduling(60*minuteinterval,12,true);
|
|
|
|
|
scheduling.setGlobal(false);
|
|
|
|
|
|
|
|
|
|
LaunchParameter launchParameter = new LaunchParameter(HelloWorldPluginDeclaration.NAME, inputs, scheduling);
|
|
|
|
@ -130,12 +131,12 @@ public class DefaultExecutorTest extends ScopedTest {
|
|
|
|
|
Thread.sleep(6000); // 12 sec (total : 22 sec)
|
|
|
|
|
Assert.assertEquals(PluginState.DONE, proxy.getStateEvolution(executionIdentifier).getPluginState());
|
|
|
|
|
|
|
|
|
|
Thread.sleep(1000*60*5); // After 5 minutes the thread should be active again
|
|
|
|
|
Thread.sleep(1000*60*minuteinterval); // After 5 minutes the thread should be active again
|
|
|
|
|
Assert.assertEquals(PluginState.RUNNING, proxy.getStateEvolution(executionIdentifier).getPluginState());
|
|
|
|
|
Assert.assertEquals(PluginState.RUNNING, proxy.getIterationStateEvolution(executionIdentifier, 1).getPluginState());
|
|
|
|
|
|
|
|
|
|
logger.debug("Trying to stop scheduled task");
|
|
|
|
|
proxy.unSchedule(executionIdentifier, true);
|
|
|
|
|
//logger.debug("Trying to stop scheduled task");
|
|
|
|
|
//proxy.unSchedule(executionIdentifier, true);
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("testOk Exception", e);
|
|
|
|
|