Code redesign
Refs #11756: Refactor DataHArvesterPlugin to support scheduled execution from smart-executor Task-Url: https://support.d4science.org/issues/11756 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-dashboard-harvester-se-plugin@167611 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
18534677ff
commit
e7de632897
|
@ -1,12 +1,11 @@
|
||||||
package org.gcube.dataharvest;
|
package org.gcube.dataharvest;
|
||||||
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.gcube.dataharvest.utils.DateUtils;
|
|
||||||
import org.gcube.dataharvest.utils.MeasureType;
|
|
||||||
import org.gcube.dataharvest.utils.ContextTest;
|
import org.gcube.dataharvest.utils.ContextTest;
|
||||||
|
import org.gcube.dataharvest.utils.MeasureType;
|
||||||
|
import org.gcube.dataharvest.utils.Utils;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -19,6 +18,8 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
public void test() {
|
public void test() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
// Utils.setContext(ROOT);
|
||||||
|
|
||||||
DataHarvestPluginDeclaration dataHarvestPluginDeclaration = new DataHarvestPluginDeclaration();
|
DataHarvestPluginDeclaration dataHarvestPluginDeclaration = new DataHarvestPluginDeclaration();
|
||||||
AccountingDataHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDataHarvesterPlugin(dataHarvestPluginDeclaration);
|
AccountingDataHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDataHarvesterPlugin(dataHarvestPluginDeclaration);
|
||||||
|
|
||||||
|
@ -26,21 +27,18 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
|
|
||||||
|
|
||||||
MeasureType measureType = MeasureType.MONTHLY;
|
MeasureType measureType = MeasureType.MONTHLY;
|
||||||
inputs.put(AccountingDataHarvesterPlugin.MEASURE_TYPE_INPUT_PARAMETER, measureType);
|
inputs.put(AccountingDataHarvesterPlugin.MEASURE_TYPE_INPUT_PARAMETER, measureType.name());
|
||||||
|
|
||||||
inputs.put(AccountingDataHarvesterPlugin.RERUN_INPUT_PARAMETER, true);
|
inputs.put(AccountingDataHarvesterPlugin.RERUN_INPUT_PARAMETER, true);
|
||||||
|
|
||||||
inputs.put(AccountingDataHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, true);
|
inputs.put(AccountingDataHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, true);
|
||||||
|
|
||||||
Calendar from
|
/*
|
||||||
//= DateUtils.getStartCalendar(2018, Calendar.APRIL, 1);
|
Calendar from = DateUtils.getStartCalendar(2018, Calendar.APRIL, 1);
|
||||||
= DateUtils.getPreviousPeriod(measureType);
|
|
||||||
|
|
||||||
String fromDate = DateUtils.LAUNCH_DATE_FORMAT.format(from.getTime());
|
String fromDate = DateUtils.LAUNCH_DATE_FORMAT.format(from.getTime());
|
||||||
logger.trace("{} is {}", AccountingDataHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
logger.trace("{} is {}", AccountingDataHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
||||||
// inputs.put(AccountingDataHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
inputs.put(AccountingDataHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
accountingDataHarvesterPlugin.launch(inputs);
|
accountingDataHarvesterPlugin.launch(inputs);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue