Merge remote-tracking branch 'origin/feature/18848' into feature/18290

Conflicts:
	src/test/java/org/gcube/dataharvest/AccountingDataHarvesterPluginTest.java
This commit is contained in:
Luca Frosini 2020-03-17 17:59:40 +01:00
commit 4fe22a57c6
2 changed files with 36 additions and 5 deletions

View File

@ -7,14 +7,14 @@ package org.gcube.dataharvest.datamodel;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* May 22, 2018
* @author M. Assante, ISTI-CNR
*/
public enum HarvestedDataKey {
CATALOGUE_ACCESSES("Catalogue Home Accesses"),
CATALOGUE_DATASET_LIST_ACCESSES("Catalogue Datasets List (Also Filtered)"),
CATALOGUE_DATASET_ACCESSES("Catalogue Dataset"),
CATALOGUE_RESOURCE_ACCESSES("Catalogue Resource"),
CATALOGUE_ACCESSES("Catalogue Accesses"),
CATALOGUE_DATASET_LIST_ACCESSES("Item List"),
CATALOGUE_DATASET_ACCESSES("Item Metadata"),
CATALOGUE_RESOURCE_ACCESSES("Item Resource"),
ACCESSES("VRE Accesses"),
USERS("VRE Users"),
DATA_METHOD_DOWNLOAD("Data/Method download"),

View File

@ -733,12 +733,22 @@ 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();
@ -757,7 +767,28 @@ 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);