|
|
|
@ -22,7 +22,6 @@ import org.gcube.accounting.analytics.persistence.AccountingPersistenceBackendQu
|
|
|
|
|
import org.gcube.accounting.analytics.persistence.AccountingPersistenceQuery;
|
|
|
|
|
import org.gcube.accounting.datamodel.aggregation.AggregatedJobUsageRecord;
|
|
|
|
|
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
|
|
|
|
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
|
|
|
|
import org.gcube.accounting.datamodel.usagerecords.JobUsageRecord;
|
|
|
|
|
import org.gcube.common.scope.api.ScopeProvider;
|
|
|
|
|
import org.json.JSONException;
|
|
|
|
@ -79,6 +78,7 @@ public class AccountingPersistenceQueryCouchBaseTest {
|
|
|
|
|
@Before
|
|
|
|
|
public void before() throws Exception{
|
|
|
|
|
|
|
|
|
|
//ScopeProvider.instance.set("/gcube/devNext/NextNext");
|
|
|
|
|
ScopeProvider.instance.set("/gcube/devNext");
|
|
|
|
|
|
|
|
|
|
AccountingPersistenceBackendQueryConfiguration configuration = new
|
|
|
|
@ -130,7 +130,7 @@ public class AccountingPersistenceQueryCouchBaseTest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void getQuerableKey() throws Exception{
|
|
|
|
|
public void getQuerableKeyJob() throws Exception{
|
|
|
|
|
SortedSet<String> keys;
|
|
|
|
|
|
|
|
|
|
keys = AccountingPersistenceQuery.getQuerableKeys(AggregatedJobUsageRecord.class);
|
|
|
|
@ -140,8 +140,6 @@ public class AccountingPersistenceQueryCouchBaseTest {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
logger.debug("List FilterKeys:" + keys.toString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@ -169,7 +167,18 @@ public class AccountingPersistenceQueryCouchBaseTest {
|
|
|
|
|
logger.debug("Result final{}", set);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void getQuerableKeyService() throws Exception{
|
|
|
|
|
SortedSet<String> keys;
|
|
|
|
|
|
|
|
|
|
keys = AccountingPersistenceQuery.getQuerableKeys(AggregatedServiceUsageRecord.class);
|
|
|
|
|
for (String key : keys) {
|
|
|
|
|
if (key != null && !key.isEmpty()) {
|
|
|
|
|
logger.debug("key:" +key);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
logger.debug("List FilterKeys:" + keys.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static SortedMap<Calendar, Info> padMap(
|
|
|
|
|
SortedMap<Calendar, Info> unpaddedData,
|
|
|
|
|