improving test

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/is-sweeper-se-plugin@146908 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2017-04-14 09:51:20 +00:00
parent 73ab296a85
commit 0df941b18a
1 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,8 @@
package org.gcube.informationsystem.sweeper;
import java.util.HashMap;
import java.util.Map;
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
import org.gcube.common.scope.api.ScopeProvider;
import org.junit.Test;
@ -13,19 +16,23 @@ public class ISSweeperPluginTest {
@Test
public void testLaunch() throws ObjectNotFound, Exception{
String[] tokens = {
ScopedTest.GCUBE,
ScopedTest.GCUBE_DEVSEC,
ScopedTest.GCUBE_DEVNEXT_NEXTNEXT,
ScopedTest.GCUBE_DEVSEC_DEVVRE,
ScopedTest.GCUBE_DEVNEXT,
ScopedTest.GCUBE_DEVNEXT_NEXTNEXT
ScopedTest.GCUBE_DEVSEC,
ScopedTest.GCUBE
};
for(String token : tokens){
logger.info("\n\n\n-------------------------------------------------------------------------");
ScopedTest.setContext(token);
try{
Map<String, Object> inputs = new HashMap<String, Object>();
inputs.put(ISSweeperPlugin.EXPIRING_MINUTES_TIMEOUT, 30);
inputs.put(ISSweeperPlugin.DEAD_DAYS_TIMEOUT, 1);
logger.debug("Inputs : {}", inputs);
ISSweeperPlugin isExporterPlugin = new ISSweeperPlugin(new ISSweeperPluginDeclaration());
isExporterPlugin.launch(null);
isExporterPlugin.launch(inputs);
}catch (Exception e) {
logger.error("Sweeper error on {}", ScopeProvider.instance.get(), e);
}