|
|
|
@ -733,22 +733,12 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
@Test
|
|
|
|
|
public void testCatalogueHarvester() {
|
|
|
|
|
try {
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
|
|
|
|
|
String context = ROOT; //"/gcube";
|
|
|
|
|
ContextTest.setContextByName(context);
|
|
|
|
|
|
|
|
|
|
AccountingDao dao = getAccountingDao();
|
|
|
|
|
|
|
|
|
|
=======
|
|
|
|
|
// String context = ROOT;
|
|
|
|
|
String context = "/gcube";
|
|
|
|
|
//Utils.setContext(RESOURCE_CATALOGUE);
|
|
|
|
|
ContextTest.setContextByName(context);
|
|
|
|
|
System.out.println("vaaa");
|
|
|
|
|
AggregationType measureType = AggregationType.MONTHLY;
|
|
|
|
|
|
|
|
|
|
>>>>>>> refs/remotes/origin/feature/18848
|
|
|
|
|
Date start = DateUtils.getStartCalendar(2020, Calendar.JANUARY, 1).getTime();
|
|
|
|
|
Date end = DateUtils.getStartCalendar(2020, Calendar.FEBRUARY, 1).getTime();
|
|
|
|
|
|
|
|
|
@ -767,28 +757,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
|
|
|
|
}
|
|
|
|
|
logger.debug("{}", accountingRecords);
|
|
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
dao.insertRecords(accountingRecords.toArray(new AccountingRecord[1]));
|
|
|
|
|
=======
|
|
|
|
|
// ContextAuthorization contextAuthorization = new ContextAuthorization();
|
|
|
|
|
// SortedSet<String> contexts = contextAuthorization.getContexts();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for(String context : contexts) {
|
|
|
|
|
ScopeBean scopeBean = new ScopeBean(context);
|
|
|
|
|
logger.debug("FullName {} - Name {}", scopeBean.toString(), scopeBean.name());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ContextTest.setContextByName(context);
|
|
|
|
|
CatalogueAccessesHarvester catalogueHarvester = new CatalogueAccessesHarvester(start, end);
|
|
|
|
|
List<AccountingRecord> data = catalogueHarvester.getAccountingRecords();
|
|
|
|
|
for (AccountingRecord accountingRecord : data) {
|
|
|
|
|
logger.debug("{}", accountingRecord);
|
|
|
|
|
}
|
|
|
|
|
logger.debug("{}", data);
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
>>>>>>> refs/remotes/origin/feature/18848
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
logger.error("", e);
|
|
|
|
|