From a0f5cc0331c5ca4f9f1487770b9840109344bf7b Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Wed, 5 Dec 2018 08:52:19 +0000 Subject: [PATCH] Fixed dependencies git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-dashboard-harvester-se-plugin@174562 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 56 +++++++++++++++++-- .../AccountingDataHarvesterPluginTest.java | 40 +++++++++++++ 2 files changed, 92 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 1c736e0..cca4b57 100644 --- a/pom.xml +++ b/pom.xml @@ -52,6 +52,12 @@ smart-executor-api [1.5.0-SNAPSHOT, 2.0.0-SNAPSHOT) provided + + + com.fasterxml.jackson.core + jackson-databind + + org.slf4j @@ -64,6 +70,11 @@ [1.3.0-SNAPSHOT,2.0.0-SNAPSHOT) provided + + commons-lang + commons-lang + 2.6 + org.gcube.core common-encryption @@ -95,6 +106,12 @@ home-library-jcr [2.0.0-SNAPSHOT,3.0.0-SNAPSHOT) provided + + + org.gcube.resources + common-gcore-resources + + @@ -104,19 +121,44 @@ compile + - org.gcube.resources.discovery - ic-client + com.fasterxml.jackson.core + jackson-core provided - org.gcube.resources - registry-publisher + com.fasterxml.jackson.core + jackson-databind + provided + + + com.fasterxml.jackson.core + jackson-annotations provided org.gcube.resources common-gcore-resources + provided + + + + + org.gcube.resources.discovery + ic-client + provided + + + org.gcube.resources + common-gcore-resources + + + + + org.gcube.resources + registry-publisher + provided @@ -135,6 +177,12 @@ org.gcube.accounting accounting-lib provided + + + com.fasterxml.jackson.core + jackson-databind + + diff --git a/src/test/java/org/gcube/dataharvest/AccountingDataHarvesterPluginTest.java b/src/test/java/org/gcube/dataharvest/AccountingDataHarvesterPluginTest.java index 4891613..cbf6592 100644 --- a/src/test/java/org/gcube/dataharvest/AccountingDataHarvesterPluginTest.java +++ b/src/test/java/org/gcube/dataharvest/AccountingDataHarvesterPluginTest.java @@ -34,6 +34,10 @@ import org.gcube.dataharvest.utils.ContextTest; import org.gcube.dataharvest.utils.DateUtils; import org.gcube.dataharvest.utils.Utils; import org.gcube.resourcemanagement.support.server.managers.context.ContextManager; +import org.gcube.vremanagement.executor.api.rest.SmartExecutor; +import org.gcube.vremanagement.executor.api.types.LaunchParameter; +import org.gcube.vremanagement.executor.client.SmartExecutorClientFactory; +import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -115,6 +119,42 @@ public class AccountingDataHarvesterPluginTest extends ContextTest { } } + + @Test + public void launchPluginOnSmartExecutor() { + try { + + Utils.setContext(ROOT); + + SmartExecutor smartExecutor = SmartExecutorClientFactory.create(DataHarvestPluginDeclaration.NAME); + Assert.assertNotNull(smartExecutor); + + Map inputs = new HashMap<>(); + + AggregationType aggregationType = AggregationType.MONTHLY; + + inputs.put(AccountingDataHarvesterPlugin.MEASURE_TYPE_INPUT_PARAMETER, aggregationType.name()); + inputs.put(AccountingDataHarvesterPlugin.GET_VRE_USERS_INPUT_PARAMETER, true); + inputs.put(AccountingDataHarvesterPlugin.RERUN_INPUT_PARAMETER, true); + inputs.put(AccountingDataHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, true); + + /* + Calendar from = DateUtils.getStartCalendar(2016, Calendar.SEPTEMBER, 1); + String fromDate = DateUtils.LAUNCH_DATE_FORMAT.format(from.getTime()); + logger.trace("{} is {}", AccountingDataHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate); + inputs.put(AccountingDataHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate); + */ + + LaunchParameter launchParameter = new LaunchParameter(DataHarvestPluginDeclaration.NAME, inputs); + smartExecutor.launch(launchParameter); + + logger.info("End."); + + } catch(Exception e) { + logger.error("", e); + } + } + // @Test public void launchOldData() { try {