refs #2032: Create IS Sweeper as SmartExecutor Plugin
https://support.d4science.org/issues/2032 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/is-sweeper-se-plugin@122922 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c4b0572bbc
commit
a73fbb5a3e
4
pom.xml
4
pom.xml
|
@ -44,7 +44,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.vremanagement</groupId>
|
||||
<artifactId>smart-executor-api</artifactId>
|
||||
<version>[1.2.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<version>[1.4.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -77,7 +77,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.vremanagement</groupId>
|
||||
<artifactId>smart-executor-client</artifactId>
|
||||
<version>[1.2.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<version>[1.3.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -21,7 +21,7 @@ public class ISSweeperPluginTest {
|
|||
|
||||
@Before
|
||||
public void beforeTest(){
|
||||
SecurityTokenProvider.instance.set("59074832-f986-46ce-9e46-5f2211300f9c");
|
||||
SecurityTokenProvider.instance.set("TOKEN-HERE");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
|
||||
import org.gcube.vremanagement.executor.api.types.Scheduling;
|
||||
|
@ -33,9 +34,10 @@ public class SmartExecutorSchedulerTest {
|
|||
|
||||
private SmartExecutorProxy proxy;
|
||||
|
||||
//@Before
|
||||
@Before
|
||||
public void before() throws Exception{
|
||||
ScopeProvider.instance.set(SCOPE);
|
||||
SecurityTokenProvider.instance.set("TOKEN-HERE");
|
||||
ScopeProvider.instance.set("/gcube/devsec");
|
||||
proxy = ExecutorPlugin.getExecutorProxy(ISSweeperPluginDeclaration.NAME).build();
|
||||
Assert.assertNotNull(proxy);
|
||||
}
|
||||
|
@ -47,11 +49,17 @@ public class SmartExecutorSchedulerTest {
|
|||
LaunchParameter parameter = new LaunchParameter(ISSweeperPluginDeclaration.NAME, inputs);
|
||||
parameter.setScheduling(scheduling);
|
||||
|
||||
String uuidString = proxy.launch(parameter);
|
||||
return UUID.fromString(uuidString);
|
||||
try {
|
||||
String uuidString = proxy.launch(parameter);
|
||||
return UUID.fromString(uuidString);
|
||||
} catch(Exception e){
|
||||
logger.error("Error laucnhing sheduled task", e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//@Test
|
||||
@Test
|
||||
public void cronExpPreviousMustBeTerminated() throws Exception {
|
||||
CronExpression cronExpression = new CronExpression("0 */10 * * * ?"); // every 10 minutes starting from now
|
||||
Scheduling scheduling = new Scheduling(cronExpression, true);
|
||||
|
|
Loading…
Reference in New Issue