Merge remote-tracking branch 'origin/feature/18848' into feature/18290
Conflicts: src/test/java/org/gcube/dataharvest/AccountingDataHarvesterPluginTest.java
This commit is contained in:
commit
4fe22a57c6
|
@ -7,14 +7,14 @@ package org.gcube.dataharvest.datamodel;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
* May 22, 2018
|
* @author M. Assante, ISTI-CNR
|
||||||
*/
|
*/
|
||||||
public enum HarvestedDataKey {
|
public enum HarvestedDataKey {
|
||||||
|
|
||||||
CATALOGUE_ACCESSES("Catalogue Home Accesses"),
|
CATALOGUE_ACCESSES("Catalogue Accesses"),
|
||||||
CATALOGUE_DATASET_LIST_ACCESSES("Catalogue Datasets List (Also Filtered)"),
|
CATALOGUE_DATASET_LIST_ACCESSES("Item List"),
|
||||||
CATALOGUE_DATASET_ACCESSES("Catalogue Dataset"),
|
CATALOGUE_DATASET_ACCESSES("Item Metadata"),
|
||||||
CATALOGUE_RESOURCE_ACCESSES("Catalogue Resource"),
|
CATALOGUE_RESOURCE_ACCESSES("Item Resource"),
|
||||||
ACCESSES("VRE Accesses"),
|
ACCESSES("VRE Accesses"),
|
||||||
USERS("VRE Users"),
|
USERS("VRE Users"),
|
||||||
DATA_METHOD_DOWNLOAD("Data/Method download"),
|
DATA_METHOD_DOWNLOAD("Data/Method download"),
|
||||||
|
|
|
@ -733,12 +733,22 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
@Test
|
@Test
|
||||||
public void testCatalogueHarvester() {
|
public void testCatalogueHarvester() {
|
||||||
try {
|
try {
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
String context = ROOT; //"/gcube";
|
String context = ROOT; //"/gcube";
|
||||||
ContextTest.setContextByName(context);
|
ContextTest.setContextByName(context);
|
||||||
|
|
||||||
AccountingDao dao = getAccountingDao();
|
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 start = DateUtils.getStartCalendar(2020, Calendar.JANUARY, 1).getTime();
|
||||||
Date end = DateUtils.getStartCalendar(2020, Calendar.FEBRUARY, 1).getTime();
|
Date end = DateUtils.getStartCalendar(2020, Calendar.FEBRUARY, 1).getTime();
|
||||||
|
|
||||||
|
@ -757,7 +767,28 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
}
|
}
|
||||||
logger.debug("{}", accountingRecords);
|
logger.debug("{}", accountingRecords);
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
dao.insertRecords(accountingRecords.toArray(new AccountingRecord[1]));
|
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) {
|
} catch(Exception e) {
|
||||||
logger.error("", e);
|
logger.error("", e);
|
||||||
|
|
Loading…
Reference in New Issue