Fixed test

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/infrastructure-tests@148801 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2017-05-17 16:05:49 +00:00
parent 9cfe2052e4
commit 9c17463c5d
1 changed files with 9 additions and 15 deletions

View File

@ -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.plugins.ExecutorPlugin;
import org.gcube.vremanagement.executor.client.proxies.SmartExecutorProxy; import org.gcube.vremanagement.executor.client.proxies.SmartExecutorProxy;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.quartz.CronExpression; import org.quartz.CronExpression;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -26,14 +25,6 @@ public class ISExporterPluginSmartExecutorSchedulerTest extends ScopedTest {
private static Logger logger = LoggerFactory.getLogger(ISExporterPluginSmartExecutorSchedulerTest.class); 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 { public UUID scheduleTest(Scheduling scheduling) throws Exception {
Map<String, Object> inputs = new HashMap<String, Object>(); Map<String, Object> inputs = new HashMap<String, Object>();
logger.debug("Inputs : {}", inputs); logger.debug("Inputs : {}", inputs);
@ -45,6 +36,8 @@ public class ISExporterPluginSmartExecutorSchedulerTest extends ScopedTest {
} }
try { try {
SmartExecutorProxy proxy = ExecutorPlugin.getExecutorProxy(ISExporterPluginDeclaration.NAME).build();
Assert.assertNotNull(proxy);
String uuidString = proxy.launch(parameter); String uuidString = proxy.launch(parameter);
return UUID.fromString(uuidString); return UUID.fromString(uuidString);
} catch(Exception e){ } catch(Exception e){
@ -58,12 +51,11 @@ public class ISExporterPluginSmartExecutorSchedulerTest extends ScopedTest {
public void cronExpPreviousMustBeTerminated() throws Exception { public void cronExpPreviousMustBeTerminated() throws Exception {
Map<String, String> tokenMinutes = new HashMap<>(); Map<String, String> tokenMinutes = new HashMap<>();
tokenMinutes.put(ScopedTest.GCUBE, "1"); tokenMinutes.put(ScopedTest.GCUBE, "0");
tokenMinutes.put(ScopedTest.GCUBE_DEVSEC, "20"); tokenMinutes.put(ScopedTest.GCUBE_DEVSEC, "12");
tokenMinutes.put(ScopedTest.GCUBE_DEVSEC_DEVVRE, "30"); tokenMinutes.put(ScopedTest.GCUBE_DEVSEC_DEVVRE, "24");
tokenMinutes.put(ScopedTest.GCUBE_DEVNEXT, "40"); tokenMinutes.put(ScopedTest.GCUBE_DEVNEXT, "36");
tokenMinutes.put(ScopedTest.GCUBE_DEVNEXT_NEXTNEXT, "50"); tokenMinutes.put(ScopedTest.GCUBE_DEVNEXT_NEXTNEXT, "48");
for(String token : tokenMinutes.keySet()){ for(String token : tokenMinutes.keySet()){
logger.info("\n\n\n-------------------------------------------------------------------------"); logger.info("\n\n\n-------------------------------------------------------------------------");
@ -84,6 +76,8 @@ public class ISExporterPluginSmartExecutorSchedulerTest extends ScopedTest {
//@Test //@Test
public void unSchedule() throws Exception { public void unSchedule() throws Exception {
SmartExecutorProxy proxy = ExecutorPlugin.getExecutorProxy(ISExporterPluginDeclaration.NAME).build();
Assert.assertNotNull(proxy);
proxy.unSchedule(null, true); proxy.unSchedule(null, true);
} }