|
|
|
@ -41,6 +41,7 @@ import org.gcube.vremanagement.executor.api.types.Scheduling;
|
|
|
|
|
import org.gcube.vremanagement.executor.client.SmartExecutorClient;
|
|
|
|
|
import org.gcube.vremanagement.executor.client.SmartExecutorClientFactory;
|
|
|
|
|
import org.junit.Assert;
|
|
|
|
|
import org.junit.Ignore;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.quartz.CronExpression;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
@ -58,19 +59,20 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
public static SortedSet<String> getContexts() throws Exception {
|
|
|
|
|
SortedSet<String> contexts = new TreeSet<>();
|
|
|
|
|
LinkedHashMap<String,ScopeBean> map = ContextManager.readContexts();
|
|
|
|
|
for(String scope : map.keySet()) {
|
|
|
|
|
LinkedHashMap<String, ScopeBean> map = ContextManager.readContexts();
|
|
|
|
|
for (String scope : map.keySet()) {
|
|
|
|
|
try {
|
|
|
|
|
String context = map.get(scope).toString();
|
|
|
|
|
contexts.add(context);
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw e;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return contexts;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Test
|
|
|
|
|
@Ignore
|
|
|
|
|
@Test
|
|
|
|
|
public void getDimensions() {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
@ -79,17 +81,18 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
AccountingDao dao = AccountingDao.get();
|
|
|
|
|
|
|
|
|
|
Set<Dimension> dimensionSet = dao.getDimensions();
|
|
|
|
|
for(Dimension d : dimensionSet) {
|
|
|
|
|
for (Dimension d : dimensionSet) {
|
|
|
|
|
logger.debug("{} - {} - {} - {}", d.getId(), d.getGroup(), d.getAggregatedMeasure(), d.getLabel());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info("End.");
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//@Ignore
|
|
|
|
|
@Test
|
|
|
|
|
public void launch() {
|
|
|
|
|
try {
|
|
|
|
@ -98,33 +101,32 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
AccountingDashboardHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDashboardHarvesterPlugin();
|
|
|
|
|
|
|
|
|
|
Map<String,Object> inputs = new HashMap<>();
|
|
|
|
|
Map<String, Object> inputs = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
AggregationType aggregationType = AggregationType.MONTHLY;
|
|
|
|
|
|
|
|
|
|
inputs.put(AccountingDashboardHarvesterPlugin.MEASURE_TYPE_INPUT_PARAMETER, aggregationType.name());
|
|
|
|
|
inputs.put(AccountingDashboardHarvesterPlugin.GET_VRE_USERS_INPUT_PARAMETER, true);
|
|
|
|
|
inputs.put(AccountingDashboardHarvesterPlugin.RERUN_INPUT_PARAMETER, true);
|
|
|
|
|
inputs.put(AccountingDashboardHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, false);
|
|
|
|
|
inputs.put(AccountingDashboardHarvesterPlugin.PARTIAL_HARVESTING, false);
|
|
|
|
|
inputs.put(AccountingDashboardHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, true);
|
|
|
|
|
inputs.put(AccountingDashboardHarvesterPlugin.PARTIAL_HARVESTING, true);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Calendar from = DateUtils.getStartCalendar(2020, Calendar.MAY, 1);
|
|
|
|
|
Calendar from = DateUtils.getStartCalendar(2021, Calendar.JANUARY, 1);
|
|
|
|
|
String fromDate = DateUtils.LAUNCH_DATE_FORMAT.format(from.getTime());
|
|
|
|
|
logger.trace("{} is {}", AccountingDashboardHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
|
|
|
|
inputs.put(AccountingDashboardHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
accountingDataHarvesterPlugin.launch(inputs);
|
|
|
|
|
|
|
|
|
|
logger.info("End.");
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Test
|
|
|
|
|
@Ignore
|
|
|
|
|
@Test
|
|
|
|
|
public void launchPluginOnSmartExecutor() {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
@ -135,7 +137,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
SmartExecutorClient smartExecutor = SmartExecutorClientFactory.getClient(pluginName);
|
|
|
|
|
Assert.assertNotNull(smartExecutor);
|
|
|
|
|
|
|
|
|
|
Map<String,Object> inputs = new HashMap<>();
|
|
|
|
|
Map<String, Object> inputs = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
AggregationType aggregationType = AggregationType.MONTHLY;
|
|
|
|
|
|
|
|
|
@ -146,14 +148,17 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
inputs.put(AccountingDashboardHarvesterPlugin.PARTIAL_HARVESTING, false);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
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);
|
|
|
|
|
*/
|
|
|
|
|
* 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);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// 3rd of the month for MONTHLY Harvesting at 10:00
|
|
|
|
|
// CronExpression cronExpression = new CronExpression("0 0 10 3 1/1 ? *");
|
|
|
|
|
// CronExpression cronExpression = new CronExpression("0 0 10 3 1/1
|
|
|
|
|
// ? *");
|
|
|
|
|
|
|
|
|
|
// Every day at 10:00 for partial harvesting
|
|
|
|
|
CronExpression cronExpression = new CronExpression("0 0 10 3 1/1 ? *");
|
|
|
|
@ -161,18 +166,20 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
Scheduling scheduling = new Scheduling(cronExpression);
|
|
|
|
|
scheduling.setGlobal(false);
|
|
|
|
|
LaunchParameter launchParameter = new LaunchParameter(pluginName, inputs, scheduling);
|
|
|
|
|
//LaunchParameter launchParameter = new LaunchParameter(pluginName, inputs);
|
|
|
|
|
// LaunchParameter launchParameter = new LaunchParameter(pluginName,
|
|
|
|
|
// inputs);
|
|
|
|
|
|
|
|
|
|
smartExecutor.launch(launchParameter);
|
|
|
|
|
|
|
|
|
|
logger.info("End.");
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Test
|
|
|
|
|
//@Ignore
|
|
|
|
|
@Test
|
|
|
|
|
public void launchOldData() {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
@ -180,7 +187,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
AccountingDashboardHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDashboardHarvesterPlugin();
|
|
|
|
|
|
|
|
|
|
Map<String,Object> inputs = new HashMap<>();
|
|
|
|
|
Map<String, Object> inputs = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
AggregationType aggregationType = AggregationType.MONTHLY;
|
|
|
|
|
|
|
|
|
@ -193,7 +200,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
Calendar runbeforeDate = DateUtils.getStartCalendar(2018, Calendar.JUNE, 1);
|
|
|
|
|
|
|
|
|
|
while(from.before(runbeforeDate)) {
|
|
|
|
|
while (from.before(runbeforeDate)) {
|
|
|
|
|
String fromDate = DateUtils.LAUNCH_DATE_FORMAT.format(from.getTime());
|
|
|
|
|
logger.trace("{} is {}", AccountingDashboardHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
|
|
|
|
inputs.put(AccountingDashboardHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
|
|
|
@ -203,11 +210,12 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
logger.info("End.");
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
// @Test
|
|
|
|
|
public void launchOldDataVREAccessesHarvester() {
|
|
|
|
|
try {
|
|
|
|
@ -228,7 +236,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
Calendar runbeforeDate = DateUtils.getStartCalendar(2018, Calendar.JUNE, 1);
|
|
|
|
|
|
|
|
|
|
while(from.before(runbeforeDate)) {
|
|
|
|
|
while (from.before(runbeforeDate)) {
|
|
|
|
|
Date start = from.getTime();
|
|
|
|
|
Date end = DateUtils.getEndDateFromStartDate(aggregationType, start, 1, false);
|
|
|
|
|
|
|
|
|
@ -238,21 +246,22 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
VREAccessesHarvester vreAccessesHarvester = null;
|
|
|
|
|
|
|
|
|
|
for(String context : contexts) {
|
|
|
|
|
for (String context : contexts) {
|
|
|
|
|
// Setting the token for the context
|
|
|
|
|
ContextTest.setContext(contextAuthorization.getTokenForContext(context));
|
|
|
|
|
|
|
|
|
|
ScopeBean scopeBean = new ScopeBean(context);
|
|
|
|
|
|
|
|
|
|
if(vreAccessesHarvester == null) {
|
|
|
|
|
if (vreAccessesHarvester == null) {
|
|
|
|
|
|
|
|
|
|
if(scopeBean.is(Type.INFRASTRUCTURE)) {
|
|
|
|
|
if (scopeBean.is(Type.INFRASTRUCTURE)) {
|
|
|
|
|
vreAccessesHarvester = new VREAccessesHarvester(start, end);
|
|
|
|
|
} else {
|
|
|
|
|
// This code should be never used because the scopes are sorted by fullname
|
|
|
|
|
// This code should be never used because the scopes
|
|
|
|
|
// are sorted by fullname
|
|
|
|
|
|
|
|
|
|
ScopeBean parent = scopeBean.enclosingScope();
|
|
|
|
|
while(!parent.is(Type.INFRASTRUCTURE)) {
|
|
|
|
|
while (!parent.is(Type.INFRASTRUCTURE)) {
|
|
|
|
|
parent = scopeBean.enclosingScope();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -268,17 +277,18 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if(context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)
|
|
|
|
|
if (context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)
|
|
|
|
|
&& start.before(DateUtils.getStartCalendar(2018, Calendar.APRIL, 1).getTime())) {
|
|
|
|
|
logger.info("Not Harvesting VREs Accesses for {} from {} to {}", context,
|
|
|
|
|
DateUtils.format(start), DateUtils.format(end));
|
|
|
|
|
} else {
|
|
|
|
|
// Collecting Google Analytics Data for VREs Accesses
|
|
|
|
|
// Collecting Google Analytics Data for VREs
|
|
|
|
|
// Accesses
|
|
|
|
|
List<AccountingRecord> harvested = vreAccessesHarvester.getAccountingRecords();
|
|
|
|
|
accountingRecords.addAll(harvested);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("Error harvesting Social Interactions for {}", context, e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -287,7 +297,8 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
accountingRecords);
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
|
|
|
|
|
// dao.insertRecords(accountingRecords.toArray(new AccountingRecord[1]));
|
|
|
|
|
// dao.insertRecords(accountingRecords.toArray(new
|
|
|
|
|
// AccountingRecord[1]));
|
|
|
|
|
|
|
|
|
|
Thread.sleep(TimeUnit.SECONDS.toMillis(10));
|
|
|
|
|
|
|
|
|
@ -297,7 +308,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -305,6 +316,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
// @Test
|
|
|
|
|
public void testScopeBean() throws Exception {
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
@ -318,13 +330,15 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
logger.info("\n\n\n");
|
|
|
|
|
|
|
|
|
|
for(String context : contexts) {
|
|
|
|
|
for (String context : contexts) {
|
|
|
|
|
ScopeBean scopeBean = new ScopeBean(context);
|
|
|
|
|
// logger.debug("FullName {} - Name {}", scopeBean.toString(), scopeBean.name());
|
|
|
|
|
// logger.debug("FullName {} - Name {}", scopeBean.toString(),
|
|
|
|
|
// scopeBean.name());
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
if(scopeBean.is(Type.VRE) && start.equals(DateUtils.getPreviousPeriod(aggregationType, false).getTime())) {
|
|
|
|
|
if (scopeBean.is(Type.VRE)
|
|
|
|
|
&& start.equals(DateUtils.getPreviousPeriod(aggregationType, false).getTime())) {
|
|
|
|
|
logger.info("Harvesting (VRE Users) for {} from {} to {}", context, DateUtils.format(start),
|
|
|
|
|
DateUtils.format(end));
|
|
|
|
|
} else {
|
|
|
|
@ -332,7 +346,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
DateUtils.format(end));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if((context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)
|
|
|
|
|
if ((context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)
|
|
|
|
|
|| context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_EU_VRE)
|
|
|
|
|
|| context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_IT_VRE))
|
|
|
|
|
&& start.before(DateUtils.getStartCalendar(2018, Calendar.APRIL, 1).getTime())) {
|
|
|
|
@ -343,7 +357,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
DateUtils.format(end));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("Error harvesting Social Interactions for {}", context, e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -351,7 +365,8 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Test
|
|
|
|
|
@Ignore
|
|
|
|
|
@Test
|
|
|
|
|
public void testVREAccessesHarvester() throws Exception {
|
|
|
|
|
try {
|
|
|
|
|
// AccountingDao dao = getAccountingDao();
|
|
|
|
@ -367,18 +382,18 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
AggregationType measureType = AggregationType.MONTHLY;
|
|
|
|
|
|
|
|
|
|
String[] contextFullNames = new String[] {"/d4science.research-infrastructures.eu/FARM/GRSF",
|
|
|
|
|
"/d4science.research-infrastructures.eu/FARM/GRSF_Admin"};
|
|
|
|
|
String[] contextFullNames = new String[] { "/d4science.research-infrastructures.eu/FARM/GRSF",
|
|
|
|
|
"/d4science.research-infrastructures.eu/FARM/GRSF_Admin" };
|
|
|
|
|
|
|
|
|
|
List<AccountingRecord> accountingRecords = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for(Date start : starts) {
|
|
|
|
|
for (Date start : starts) {
|
|
|
|
|
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
|
|
|
|
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
VREAccessesHarvester vreAccessesHarvester = new VREAccessesHarvester(start, end);
|
|
|
|
|
|
|
|
|
|
for(String contextFullname : contextFullNames) {
|
|
|
|
|
for (String contextFullname : contextFullNames) {
|
|
|
|
|
|
|
|
|
|
setContextByNameAndScopeDescriptor(contextFullname);
|
|
|
|
|
|
|
|
|
@ -393,14 +408,16 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
logger.debug("{}", accountingRecords);
|
|
|
|
|
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
// dao.insertRecords(accountingRecords.toArray(new AccountingRecord[1]));
|
|
|
|
|
// dao.insertRecords(accountingRecords.toArray(new
|
|
|
|
|
// AccountingRecord[1]));
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
throw e;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
// @Test
|
|
|
|
|
public void testVREAccessesHarvesterAll() {
|
|
|
|
|
try {
|
|
|
|
@ -409,8 +426,10 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
AggregationType measureType = AggregationType.MONTHLY;
|
|
|
|
|
|
|
|
|
|
// Date start = DateUtils.getStartCalendar(2015, Calendar.FEBRUARY, 1).getTime();
|
|
|
|
|
// Date end = DateUtils.getStartCalendar(2019, Calendar.FEBRUARY, 1).getTime();
|
|
|
|
|
// Date start = DateUtils.getStartCalendar(2015, Calendar.FEBRUARY,
|
|
|
|
|
// 1).getTime();
|
|
|
|
|
// Date end = DateUtils.getStartCalendar(2019, Calendar.FEBRUARY,
|
|
|
|
|
// 1).getTime();
|
|
|
|
|
|
|
|
|
|
Date start = DateUtils.getPreviousPeriod(measureType, false).getTime();
|
|
|
|
|
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
|
|
|
@ -425,21 +444,22 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
ArrayList<AccountingRecord> accountingRecords = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for(String context : contexts) {
|
|
|
|
|
for (String context : contexts) {
|
|
|
|
|
// Setting the token for the context
|
|
|
|
|
ContextTest.setContext(contextAuthorization.getTokenForContext(context));
|
|
|
|
|
|
|
|
|
|
ScopeBean scopeBean = new ScopeBean(context);
|
|
|
|
|
|
|
|
|
|
if(vreAccessesHarvester == null) {
|
|
|
|
|
if (vreAccessesHarvester == null) {
|
|
|
|
|
|
|
|
|
|
if(scopeBean.is(Type.INFRASTRUCTURE)) {
|
|
|
|
|
if (scopeBean.is(Type.INFRASTRUCTURE)) {
|
|
|
|
|
vreAccessesHarvester = new VREAccessesHarvester(start, end);
|
|
|
|
|
} else {
|
|
|
|
|
// This code should be never used because the scopes are sorted by fullname
|
|
|
|
|
// This code should be never used because the scopes are
|
|
|
|
|
// sorted by fullname
|
|
|
|
|
|
|
|
|
|
ScopeBean parent = scopeBean.enclosingScope();
|
|
|
|
|
while(!parent.is(Type.INFRASTRUCTURE)) {
|
|
|
|
|
while (!parent.is(Type.INFRASTRUCTURE)) {
|
|
|
|
|
parent = scopeBean.enclosingScope();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -455,7 +475,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if(context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)
|
|
|
|
|
if (context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)
|
|
|
|
|
&& start.before(DateUtils.getStartCalendar(2018, Calendar.APRIL, 1).getTime())) {
|
|
|
|
|
logger.info("Not Harvesting VREs Accesses for {} from {} to {}", context,
|
|
|
|
|
DateUtils.format(start), DateUtils.format(end));
|
|
|
|
@ -464,18 +484,19 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
List<AccountingRecord> harvested = vreAccessesHarvester.getAccountingRecords();
|
|
|
|
|
accountingRecords.addAll(harvested);
|
|
|
|
|
}
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("Error harvesting Social Interactions for {}", context, e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.debug("{}", accountingRecords);
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
// @Test
|
|
|
|
|
public void testSocialInteraction() {
|
|
|
|
|
try {
|
|
|
|
@ -507,7 +528,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
ArrayList<AccountingRecord> accountingRecords = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for(String context : contexts) {
|
|
|
|
|
for (String context : contexts) {
|
|
|
|
|
// Setting the token for the context
|
|
|
|
|
ContextTest.setContext(contextAuthorization.getTokenForContext(context));
|
|
|
|
|
try {
|
|
|
|
@ -516,7 +537,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
SocialInteractionsHarvester socialHarvester = new SocialInteractionsHarvester(start, end);
|
|
|
|
|
List<AccountingRecord> harvested = socialHarvester.getAccountingRecords();
|
|
|
|
|
accountingRecords.addAll(harvested);
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("Error harvesting Social Interactions for {}", context, e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -524,9 +545,10 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
logger.debug("Harvest Measures from {} to {} are {}", DateUtils.format(start), DateUtils.format(end),
|
|
|
|
|
accountingRecords);
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
// dao.insertRecords(accountingRecords.toArray(new AccountingRecord[1]));
|
|
|
|
|
// dao.insertRecords(accountingRecords.toArray(new
|
|
|
|
|
// AccountingRecord[1]));
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -534,6 +556,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
// @Test
|
|
|
|
|
public void testMethodInvocation() {
|
|
|
|
|
try {
|
|
|
|
@ -554,7 +577,52 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
logger.debug("{}", accountingRecords);
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testMethodInvocationOldData() {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
AccountingDao dao = getAccountingDao();
|
|
|
|
|
|
|
|
|
|
List<Date> starts = new ArrayList<>();
|
|
|
|
|
starts.add(DateUtils.getStartCalendar(2021, Calendar.APRIL, 1).getTime());
|
|
|
|
|
|
|
|
|
|
AggregationType measureType = AggregationType.MONTHLY;
|
|
|
|
|
|
|
|
|
|
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
|
|
|
|
SortedSet<String> contexts = contextAuthorization.getContexts();
|
|
|
|
|
|
|
|
|
|
List<AccountingRecord> accountingRecords = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (Date start : starts) {
|
|
|
|
|
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
|
|
|
|
|
|
|
|
|
MethodInvocationHarvester methodInvocationHarvester = new MethodInvocationHarvester(start, end);
|
|
|
|
|
|
|
|
|
|
for (String context : contexts) {
|
|
|
|
|
// Setting the token for the context
|
|
|
|
|
ContextTest.setContext(contextAuthorization.getTokenForContext(context));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AccountingRecord> harvested = methodInvocationHarvester.getAccountingRecords();
|
|
|
|
|
accountingRecords.addAll(harvested);
|
|
|
|
|
|
|
|
|
|
logger.debug("{} - {}", context, harvested);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.debug("Going to insert {}", accountingRecords);
|
|
|
|
|
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
dao.insertRecords(accountingRecords.toArray(new AccountingRecord[1]));
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -563,15 +631,15 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
AccountingDao dao = AccountingDao.get();
|
|
|
|
|
|
|
|
|
|
Set<ScopeDescriptor> scopeDescriptorSet = dao.getContexts();
|
|
|
|
|
Map<String,ScopeDescriptor> scopeDescriptorMap = new HashMap<>();
|
|
|
|
|
for(ScopeDescriptor scopeDescriptor : scopeDescriptorSet) {
|
|
|
|
|
Map<String, ScopeDescriptor> scopeDescriptorMap = new HashMap<>();
|
|
|
|
|
for (ScopeDescriptor scopeDescriptor : scopeDescriptorSet) {
|
|
|
|
|
scopeDescriptorMap.put(scopeDescriptor.getId(), scopeDescriptor);
|
|
|
|
|
}
|
|
|
|
|
AccountingDashboardHarvesterPlugin.scopeDescriptors.set(scopeDescriptorMap);
|
|
|
|
|
|
|
|
|
|
Set<Dimension> dimensionSet = dao.getDimensions();
|
|
|
|
|
Map<String,Dimension> dimensionMap = new HashMap<>();
|
|
|
|
|
for(Dimension dimension : dimensionSet) {
|
|
|
|
|
Map<String, Dimension> dimensionMap = new HashMap<>();
|
|
|
|
|
for (Dimension dimension : dimensionSet) {
|
|
|
|
|
dimensionMap.put(dimension.getId(), dimension);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -589,13 +657,14 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
ScopeBean scopeBean = new ScopeBean(contextFullName);
|
|
|
|
|
ScopeDescriptor actualScopeDescriptor = AccountingDashboardHarvesterPlugin.scopeDescriptors.get()
|
|
|
|
|
.get(contextFullName);
|
|
|
|
|
if(actualScopeDescriptor == null) {
|
|
|
|
|
if (actualScopeDescriptor == null) {
|
|
|
|
|
actualScopeDescriptor = new ScopeDescriptor(scopeBean.name(), contextFullName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AccountingDashboardHarvesterPlugin.scopeDescriptor.set(actualScopeDescriptor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
// @Test
|
|
|
|
|
public void testTagMeMethodInvocation() throws Exception {
|
|
|
|
|
try {
|
|
|
|
@ -613,7 +682,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
starts.add(DateUtils.getStartCalendar(2019, Calendar.FEBRUARY, 1).getTime());
|
|
|
|
|
starts.add(DateUtils.getStartCalendar(2019, Calendar.MARCH, 1).getTime());
|
|
|
|
|
|
|
|
|
|
for(Date start : starts) {
|
|
|
|
|
for (Date start : starts) {
|
|
|
|
|
|
|
|
|
|
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
|
|
|
|
|
|
|
|
@ -625,14 +694,16 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
// dao.insertRecords(accountingRecords.toArray(new AccountingRecord[1]));
|
|
|
|
|
// dao.insertRecords(accountingRecords.toArray(new
|
|
|
|
|
// AccountingRecord[1]));
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
throw e;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
// @Test
|
|
|
|
|
public void testGetVREUsersForSpecificVRE() {
|
|
|
|
|
try {
|
|
|
|
@ -659,19 +730,21 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
logger.info("Harvested Data from {} to {} : {}", DateUtils.format(start), DateUtils.format(end), harvested);
|
|
|
|
|
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
// dao.insertRecords(accountingRecords.toArray(new AccountingRecord[1]));
|
|
|
|
|
// dao.insertRecords(accountingRecords.toArray(new
|
|
|
|
|
// AccountingRecord[1]));
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
// @Test
|
|
|
|
|
public void testFilteringGenericResource() {
|
|
|
|
|
try {
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
//Utils.setContext(RESOURCE_CATALOGUE);
|
|
|
|
|
// Utils.setContext(RESOURCE_CATALOGUE);
|
|
|
|
|
|
|
|
|
|
AggregationType measureType = AggregationType.MONTHLY;
|
|
|
|
|
|
|
|
|
@ -688,23 +761,26 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
SortedSet<String> validContexts = resourceCatalogueHarvester.getValidContexts(contexts, SO_BIG_VO + "/");
|
|
|
|
|
logger.info("Valid Contexts {}", validContexts);
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
// @Test
|
|
|
|
|
public void testResourceCatalogueHarvester() {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
//Utils.setContext(RESOURCE_CATALOGUE);
|
|
|
|
|
// Utils.setContext(RESOURCE_CATALOGUE);
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
|
|
|
|
|
AggregationType measureType = AggregationType.MONTHLY;
|
|
|
|
|
|
|
|
|
|
// Date start = DateUtils.getStartCalendar(2015, Calendar.FEBRUARY, 1).getTime();
|
|
|
|
|
// Date end = DateUtils.getStartCalendar(2019, Calendar.FEBRUARY, 1).getTime();
|
|
|
|
|
// Date start = DateUtils.getStartCalendar(2015, Calendar.FEBRUARY,
|
|
|
|
|
// 1).getTime();
|
|
|
|
|
// Date end = DateUtils.getStartCalendar(2019, Calendar.FEBRUARY,
|
|
|
|
|
// 1).getTime();
|
|
|
|
|
|
|
|
|
|
Date start = DateUtils.getPreviousPeriod(measureType, false).getTime();
|
|
|
|
|
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
|
|
|
@ -720,16 +796,17 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
logger.debug("{}", data);
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
@Test
|
|
|
|
|
public void testCoreServicesHarvester() {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
String context = ROOT; //"/gcube";
|
|
|
|
|
String context = ROOT; // "/gcube";
|
|
|
|
|
ContextTest.setContextByName(context);
|
|
|
|
|
|
|
|
|
|
AccountingDao dao = getAccountingDao();
|
|
|
|
@ -742,7 +819,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
ScopeBean scopeBean = new ScopeBean(context);
|
|
|
|
|
logger.debug("FullName {} - Name {}", scopeBean.toString(), scopeBean.name());
|
|
|
|
|
|
|
|
|
|
while(end.before(finalEnd)) {
|
|
|
|
|
while (end.before(finalEnd)) {
|
|
|
|
|
CoreServicesAccessesHarvester coreServicesHarvester = new CoreServicesAccessesHarvester(start, end);
|
|
|
|
|
List<AccountingRecord> accountingRecords = coreServicesHarvester.getAccountingRecords();
|
|
|
|
|
dao.insertRecords(accountingRecords.toArray(new AccountingRecord[1]));
|
|
|
|
@ -755,18 +832,17 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
end = DateUtils.getEndDateFromStartDate(AggregationType.MONTHLY, start, 1, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
@Test
|
|
|
|
|
public void testCatalogueHarvester() {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
String context = ROOT; //"/gcube";
|
|
|
|
|
String context = ROOT; // "/gcube";
|
|
|
|
|
ContextTest.setContextByName(context);
|
|
|
|
|
|
|
|
|
|
AccountingDao dao = getAccountingDao();
|
|
|
|
@ -775,8 +851,8 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
Date end = DateUtils.getStartCalendar(2020, Calendar.FEBRUARY, 1).getTime();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Date start = DateUtils.getPreviousPeriod(measureType, false).getTime();
|
|
|
|
|
* Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
|
|
|
|
* Date start = DateUtils.getPreviousPeriod(measureType, false).getTime(); Date
|
|
|
|
|
* end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
ScopeBean scopeBean = new ScopeBean(context);
|
|
|
|
@ -791,23 +867,25 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
dao.insertRecords(accountingRecords.toArray(new AccountingRecord[1]));
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
// @Test
|
|
|
|
|
public void testDataMethodDownloadHarvester() {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
//Utils.setContext(RESOURCE_CATALOGUE);
|
|
|
|
|
// Utils.setContext(RESOURCE_CATALOGUE);
|
|
|
|
|
ContextTest.setContextByName(ROOT);
|
|
|
|
|
|
|
|
|
|
AggregationType measureType = AggregationType.MONTHLY;
|
|
|
|
|
|
|
|
|
|
// Date start = DateUtils.getStartCalendar(2015, Calendar.FEBRUARY, 1).getTime();
|
|
|
|
|
// Date end = DateUtils.getStartCalendar(2019, Calendar.FEBRUARY, 1).getTime();
|
|
|
|
|
// Date start = DateUtils.getStartCalendar(2015, Calendar.FEBRUARY,
|
|
|
|
|
// 1).getTime();
|
|
|
|
|
// Date end = DateUtils.getStartCalendar(2019, Calendar.FEBRUARY,
|
|
|
|
|
// 1).getTime();
|
|
|
|
|
|
|
|
|
|
Date start = DateUtils.getPreviousPeriod(measureType, false).getTime();
|
|
|
|
|
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
|
|
|
@ -818,13 +896,13 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
|
|
|
|
SortedSet<String> contexts = contextAuthorization.getContexts();
|
|
|
|
|
|
|
|
|
|
for(String context : contexts) {
|
|
|
|
|
for (String context : contexts) {
|
|
|
|
|
ScopeBean scopeBean = new ScopeBean(context);
|
|
|
|
|
logger.debug("FullName {} - Name {}", scopeBean.toString(), scopeBean.name());
|
|
|
|
|
|
|
|
|
|
if(context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)) {
|
|
|
|
|
if(scopeBean.is(Type.VRE)) {
|
|
|
|
|
if(context.startsWith(TAGME_VRE)) {
|
|
|
|
|
if (context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)) {
|
|
|
|
|
if (scopeBean.is(Type.VRE)) {
|
|
|
|
|
if (context.startsWith(TAGME_VRE)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
ContextTest.setContext(contextAuthorization.getTokenForContext(context));
|
|
|
|
@ -837,13 +915,14 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static final String E_LEARNING_AREA_VRE = "/d4science.research-infrastructures.eu/SoBigData/E-Learning_Area";
|
|
|
|
|
|
|
|
|
|
@Ignore
|
|
|
|
|
// @Test
|
|
|
|
|
public void addMissingVREAccesses() {
|
|
|
|
|
try {
|
|
|
|
@ -860,15 +939,15 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
AccountingDao dao = AccountingDao.get();
|
|
|
|
|
|
|
|
|
|
Set<ScopeDescriptor> scopeDescriptorSet = dao.getContexts();
|
|
|
|
|
Map<String,ScopeDescriptor> scopeDescriptorMap = new HashMap<>();
|
|
|
|
|
for(ScopeDescriptor scopeDescriptor : scopeDescriptorSet) {
|
|
|
|
|
Map<String, ScopeDescriptor> scopeDescriptorMap = new HashMap<>();
|
|
|
|
|
for (ScopeDescriptor scopeDescriptor : scopeDescriptorSet) {
|
|
|
|
|
scopeDescriptorMap.put(scopeDescriptor.getId(), scopeDescriptor);
|
|
|
|
|
}
|
|
|
|
|
AccountingDashboardHarvesterPlugin.scopeDescriptors.set(scopeDescriptorMap);
|
|
|
|
|
|
|
|
|
|
Set<Dimension> dimensionSet = dao.getDimensions();
|
|
|
|
|
Map<String,Dimension> dimensionMap = new HashMap<>();
|
|
|
|
|
for(Dimension dimension : dimensionSet) {
|
|
|
|
|
Map<String, Dimension> dimensionMap = new HashMap<>();
|
|
|
|
|
for (Dimension dimension : dimensionSet) {
|
|
|
|
|
dimensionMap.put(dimension.getId(), dimension);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -890,13 +969,13 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
Calendar calendar = DateUtils.getStartCalendar(2018, Calendar.JULY, 1);
|
|
|
|
|
calendar.set(Calendar.DAY_OF_MONTH, 15);
|
|
|
|
|
|
|
|
|
|
Map<Integer,Integer> monthValues = new HashMap<>();
|
|
|
|
|
Map<Integer, Integer> monthValues = new HashMap<>();
|
|
|
|
|
monthValues.put(Calendar.JULY, 54);
|
|
|
|
|
monthValues.put(Calendar.AUGUST, 23);
|
|
|
|
|
monthValues.put(Calendar.SEPTEMBER, 127);
|
|
|
|
|
monthValues.put(Calendar.OCTOBER, 192);
|
|
|
|
|
|
|
|
|
|
for(Integer month : monthValues.keySet()) {
|
|
|
|
|
for (Integer month : monthValues.keySet()) {
|
|
|
|
|
calendar.set(Calendar.MONTH, month);
|
|
|
|
|
Instant instant = calendar.toInstant();
|
|
|
|
|
|
|
|
|
@ -909,7 +988,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
logger.trace("{}", accountingRecords);
|
|
|
|
|
dao.insertRecords(accountingRecords.toArray(new AccountingRecord[1]));
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|