diff --git a/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java b/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java index 762a185..634fbbd 100644 --- a/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java +++ b/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java @@ -8,9 +8,7 @@ import java.util.HashMap; import java.util.Map; import org.gcube.accounting.aggregator.aggregation.AggregationType; -import org.gcube.accounting.aggregator.plugin.AccountingAggregatorPlugin; import org.gcube.accounting.aggregator.plugin.AccountingAggregatorPlugin.ElaborationType; -import org.gcube.accounting.aggregator.plugin.AccountingAggregatorPluginDeclaration; import org.gcube.accounting.aggregator.utility.Utility; import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord; import org.gcube.testutility.ScopedTest; @@ -42,8 +40,8 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped Map inputs = new HashMap(); inputs.put(AccountingAggregatorPlugin.ELABORATION_TYPE_INPUT_PARAMETER, ElaborationType.RECOVERY.name()); - inputs.put(AccountingAggregatorPlugin.PERSIST_START_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(8, 0)); - inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(18, 0)); + inputs.put(AccountingAggregatorPlugin.PERSIST_START_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(4, 0)); + inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(20, 0)); return inputs; } @@ -54,15 +52,15 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped inputs.put(AccountingAggregatorPlugin.ELABORATION_TYPE_INPUT_PARAMETER, ElaborationType.AGGREGATE.name()); - inputs.put(AccountingAggregatorPlugin.PERSIST_START_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(8, 0)); - inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(18, 0)); + inputs.put(AccountingAggregatorPlugin.PERSIST_START_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(3, 0)); + inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(19, 00)); inputs.put(AccountingAggregatorPlugin.RECORD_TYPE_INPUT_PARAMETER, ServiceUsageRecord.class.newInstance().getRecordType()); // Start Aggregation Date - Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2014, Calendar.JANUARY, - 1); + Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2017, Calendar.APRIL, + 17); String aggregationStartDate = AccountingAggregatorPlugin.AGGREGATION_START_DATE_DATE_FORMAT .format(aggregationStartCalendar.getTime()); logger.trace("{} : {}", AccountingAggregatorPlugin.AGGREGATION_START_DATE_INPUT_PARAMETER, @@ -90,13 +88,13 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped @Test public void aggregate() throws Exception { - // Every 15 minutes - CronExpression cronExpression = new CronExpression("0 0/15 * 1/1 * ? *"); + // Every 5 minutes + CronExpression cronExpression = new CronExpression("0 0/5 * 1/1 * ? *"); Scheduling scheduling = new Scheduling(cronExpression, true); scheduling.setGlobal(false); Map inputs = getAggregateInputs(); - + launch(null, inputs); } @@ -104,24 +102,24 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped @Test public void recovery() throws Exception { // Every Day at 8:00 - CronExpression cronExpression = new CronExpression("0 0 8,12,16 1/1 * ? *"); + CronExpression cronExpression = new CronExpression("0 0/15 4-19 1/1 * ? *"); Scheduling scheduling = new Scheduling(cronExpression, true); scheduling.setGlobal(false); Map inputs = getRecoveryInputs(); - launch(scheduling, inputs); + launch(null, inputs); } @Test public void unSchedule() throws Exception { - // proxy.unSchedule("", true); + proxy.unSchedule("d06fc539-af83-4dae-a274-c721b4710fcd", true); } @Test public void stop() throws Exception { - proxy.stop(AccountingAggregatorPluginDeclaration.NAME); + proxy.stop("91178b6e-811f-410d-9cff-ef7b4a7a2475"); } }