From 66e0df8d1bc30fe8fe4b3387b50aed9c52599543 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 4 Aug 2017 09:09:55 +0000 Subject: [PATCH] Refactoring Infrastructure Tests git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/infrastructure-tests@152481 82a268e6-3cf1-43bd-a215-b396298e98cf --- ...ntingPluginSmartExecutorSchedulerTest.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) 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 a765ffd..73df491 100644 --- a/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java +++ b/src/test/java/org/gcube/accounting/aggregator/plugin/AggregatorAccountingPluginSmartExecutorSchedulerTest.java @@ -38,11 +38,11 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped } - private String getPersistEndTimeParameter() { + private String getPersistTimeParameter(int hour, int minute) { Calendar persistEndTime = Calendar.getInstance(); - persistEndTime.set(Calendar.HOUR_OF_DAY, 18); - persistEndTime.set(Calendar.MINUTE, 00); - String persistEndTimeParameter = AccountingAggregatorPlugin.RECOVERY_END_TIME_DATE_FORMAT + persistEndTime.set(Calendar.HOUR_OF_DAY, hour); + persistEndTime.set(Calendar.MINUTE, minute); + String persistEndTimeParameter = AccountingAggregatorPlugin.PERSIST_TIME_DATE_FORMAT .format(persistEndTime.getTime()); return persistEndTimeParameter; } @@ -51,8 +51,8 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped Map inputs = new HashMap(); inputs.put(AccountingAggregatorPlugin.ELABORATION_TYPE_INPUT_PARAMETER, ElaborationType.RECOVERY.name()); - String persistEndTimeParameter = getPersistEndTimeParameter(); - inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, persistEndTimeParameter); + inputs.put(AccountingAggregatorPlugin.PERSIST_START_TIME_INPUT_PARAMETER, getPersistTimeParameter(8, 0)); + inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, getPersistTimeParameter(18, 0)); return inputs; } @@ -63,8 +63,8 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped inputs.put(AccountingAggregatorPlugin.ELABORATION_TYPE_INPUT_PARAMETER, ElaborationType.AGGREGATE.name()); - String persistEndTimeParameter = getPersistEndTimeParameter(); - inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, persistEndTimeParameter); + inputs.put(AccountingAggregatorPlugin.PERSIST_START_TIME_INPUT_PARAMETER, getPersistTimeParameter(8, 0)); + inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, getPersistTimeParameter(18, 0)); inputs.put(AccountingAggregatorPlugin.RECORD_TYPE_INPUT_PARAMETER, ServiceUsageRecord.class.newInstance().getRecordType()); @@ -102,7 +102,7 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped // Every 15 minutes CronExpression cronExpression = new CronExpression("0 0/15 * 1/1 * ? *"); Scheduling scheduling = new Scheduling(cronExpression, false); - scheduling.setGlobal(true); + scheduling.setGlobal(false); Map inputs = getAggregateInputs(); @@ -113,9 +113,9 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped @Test public void recovery() throws Exception { // Every Day at 8:00 - CronExpression cronExpression = new CronExpression("0 0 8 1/1 * ? *"); - Scheduling scheduling = new Scheduling(cronExpression, false); - scheduling.setGlobal(true); + CronExpression cronExpression = new CronExpression("0 0 8,12,16 1/1 * ? *"); + Scheduling scheduling = new Scheduling(cronExpression, true); + scheduling.setGlobal(false); Map inputs = getRecoveryInputs();