From 9c17463c5df577e05a5f569d515b5e63dcf815b4 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 17 May 2017 16:05:49 +0000 Subject: [PATCH] Fixed test git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/infrastructure-tests@148801 82a268e6-3cf1-43bd-a215-b396298e98cf --- ...orterPluginSmartExecutorSchedulerTest.java | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/test/java/org/gcube/informationsystem/exporter/ISExporterPluginSmartExecutorSchedulerTest.java b/src/test/java/org/gcube/informationsystem/exporter/ISExporterPluginSmartExecutorSchedulerTest.java index ef9788c..72fe9a0 100644 --- a/src/test/java/org/gcube/informationsystem/exporter/ISExporterPluginSmartExecutorSchedulerTest.java +++ b/src/test/java/org/gcube/informationsystem/exporter/ISExporterPluginSmartExecutorSchedulerTest.java @@ -13,7 +13,6 @@ import org.gcube.vremanagement.executor.api.types.Scheduling; import org.gcube.vremanagement.executor.client.plugins.ExecutorPlugin; import org.gcube.vremanagement.executor.client.proxies.SmartExecutorProxy; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; import org.quartz.CronExpression; import org.slf4j.Logger; @@ -26,14 +25,6 @@ public class ISExporterPluginSmartExecutorSchedulerTest extends ScopedTest { private static Logger logger = LoggerFactory.getLogger(ISExporterPluginSmartExecutorSchedulerTest.class); - private SmartExecutorProxy proxy; - - @Before - public void before() throws Exception{ - proxy = ExecutorPlugin.getExecutorProxy(ISExporterPluginDeclaration.NAME).build(); - Assert.assertNotNull(proxy); - } - public UUID scheduleTest(Scheduling scheduling) throws Exception { Map inputs = new HashMap(); logger.debug("Inputs : {}", inputs); @@ -45,6 +36,8 @@ public class ISExporterPluginSmartExecutorSchedulerTest extends ScopedTest { } try { + SmartExecutorProxy proxy = ExecutorPlugin.getExecutorProxy(ISExporterPluginDeclaration.NAME).build(); + Assert.assertNotNull(proxy); String uuidString = proxy.launch(parameter); return UUID.fromString(uuidString); } catch(Exception e){ @@ -58,12 +51,11 @@ public class ISExporterPluginSmartExecutorSchedulerTest extends ScopedTest { public void cronExpPreviousMustBeTerminated() throws Exception { Map tokenMinutes = new HashMap<>(); - tokenMinutes.put(ScopedTest.GCUBE, "1"); - tokenMinutes.put(ScopedTest.GCUBE_DEVSEC, "20"); - tokenMinutes.put(ScopedTest.GCUBE_DEVSEC_DEVVRE, "30"); - tokenMinutes.put(ScopedTest.GCUBE_DEVNEXT, "40"); - tokenMinutes.put(ScopedTest.GCUBE_DEVNEXT_NEXTNEXT, "50"); - + tokenMinutes.put(ScopedTest.GCUBE, "0"); + tokenMinutes.put(ScopedTest.GCUBE_DEVSEC, "12"); + tokenMinutes.put(ScopedTest.GCUBE_DEVSEC_DEVVRE, "24"); + tokenMinutes.put(ScopedTest.GCUBE_DEVNEXT, "36"); + tokenMinutes.put(ScopedTest.GCUBE_DEVNEXT_NEXTNEXT, "48"); for(String token : tokenMinutes.keySet()){ logger.info("\n\n\n-------------------------------------------------------------------------"); @@ -84,6 +76,8 @@ public class ISExporterPluginSmartExecutorSchedulerTest extends ScopedTest { //@Test public void unSchedule() throws Exception { + SmartExecutorProxy proxy = ExecutorPlugin.getExecutorProxy(ISExporterPluginDeclaration.NAME).build(); + Assert.assertNotNull(proxy); proxy.unSchedule(null, true); }