Fixing tests
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/infrastructure-tests@125656 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
bfd3f9ea4d
commit
829e3fa4a5
24
pom.xml
24
pom.xml
|
@ -28,31 +28,37 @@
|
||||||
<groupId>org.gcube.data.publishing</groupId>
|
<groupId>org.gcube.data.publishing</groupId>
|
||||||
<artifactId>document-store-lib</artifactId>
|
<artifactId>document-store-lib</artifactId>
|
||||||
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.data.publishing</groupId>
|
<groupId>org.gcube.data.publishing</groupId>
|
||||||
<artifactId>document-store-lib-couchbase</artifactId>
|
<artifactId>document-store-lib-couchbase</artifactId>
|
||||||
<version>[1.0.1-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.1-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.reflections</groupId>
|
<groupId>org.reflections</groupId>
|
||||||
<artifactId>reflections</artifactId>
|
<artifactId>reflections</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>0.9.10</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.data.publishing</groupId>
|
<groupId>org.gcube.data.publishing</groupId>
|
||||||
<artifactId>document-store-lib-couchdb</artifactId>
|
<artifactId>document-store-lib-couchdb</artifactId>
|
||||||
<version>[1.0.1-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.1-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>couchdb-connector</artifactId>
|
<artifactId>couchdb-connector</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.data.publishing</groupId>
|
<groupId>org.gcube.data.publishing</groupId>
|
||||||
<artifactId>document-store-lib-mongodb</artifactId>
|
<artifactId>document-store-lib-mongodb</artifactId>
|
||||||
<version>[1.0.1-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.1-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,17 +66,20 @@
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>accounting-lib</artifactId>
|
<artifactId>accounting-lib</artifactId>
|
||||||
<version>[2.2.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
<version>[2.2.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>accounting-analytics</artifactId>
|
<artifactId>accounting-analytics</artifactId>
|
||||||
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>accounting-analytics-persistence-couchdb</artifactId>
|
<artifactId>accounting-analytics-persistence-couchdb</artifactId>
|
||||||
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -78,6 +87,7 @@
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>accounting-analytics-persistence-couchbase</artifactId>
|
<artifactId>accounting-analytics-persistence-couchbase</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
@ -85,33 +95,39 @@
|
||||||
<groupId>org.gcube.vremanagement</groupId>
|
<groupId>org.gcube.vremanagement</groupId>
|
||||||
<artifactId>smart-executor</artifactId>
|
<artifactId>smart-executor</artifactId>
|
||||||
<version>[1.4.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
<version>[1.4.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
<type>war</type>
|
<type>war</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.vremanagement</groupId>
|
<groupId>org.gcube.vremanagement</groupId>
|
||||||
<artifactId>smart-executor-client</artifactId>
|
<artifactId>smart-executor-client</artifactId>
|
||||||
<version>[1.3.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
<version>[1.3.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>couchdb-cache-se-plugin</artifactId>
|
<artifactId>couchdb-cache-se-plugin</artifactId>
|
||||||
<version>[1.1.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
<version>[1.1.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.information-system</groupId>
|
<groupId>org.gcube.information-system</groupId>
|
||||||
<artifactId>is-sweeper-se-plugin</artifactId>
|
<artifactId>is-sweeper-se-plugin</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.acme</groupId>
|
<groupId>org.acme</groupId>
|
||||||
<artifactId>HelloWorldPlugin</artifactId>
|
<artifactId>HelloWorldPlugin</artifactId>
|
||||||
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--
|
<!--
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.dataanalysis</groupId>
|
<groupId>org.gcube.dataanalysis</groupId>
|
||||||
<artifactId>smart-generic-worker</artifactId>
|
<artifactId>smart-generic-worker</artifactId>
|
||||||
<version>[1.0.1-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.1-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
@ -120,33 +136,39 @@
|
||||||
<groupId>org.gcube.core</groupId>
|
<groupId>org.gcube.core</groupId>
|
||||||
<artifactId>common-scope</artifactId>
|
<artifactId>common-scope</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.resources</groupId>
|
<groupId>org.gcube.resources</groupId>
|
||||||
<artifactId>registry-publisher</artifactId>
|
<artifactId>registry-publisher</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.core</groupId>
|
<groupId>org.gcube.core</groupId>
|
||||||
<artifactId>common-encryption</artifactId>
|
<artifactId>common-encryption</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<version>1.7.5</version>
|
<version>1.7.5</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ch.qos.logback</groupId>
|
<groupId>ch.qos.logback</groupId>
|
||||||
<artifactId>logback-classic</artifactId>
|
<artifactId>logback-classic</artifactId>
|
||||||
<version>1.0.13</version>
|
<version>1.0.13</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>4.11</version>
|
<version>4.11</version>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||||
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
||||||
import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord;
|
import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord;
|
||||||
import org.gcube.accounting.datamodel.usagerecords.StorageUsageRecord;
|
import org.gcube.accounting.datamodel.usagerecords.StorageUsageRecord;
|
||||||
|
import org.gcube.documentstore.records.AggregatedRecord;
|
||||||
import org.gcube.testutility.ScopedTest;
|
import org.gcube.testutility.ScopedTest;
|
||||||
import org.gcube.testutility.TestUsageRecord;
|
import org.gcube.testutility.TestUsageRecord;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
@ -38,11 +39,11 @@ public class AccountingPersistenceQueryFactoryTest extends ScopedTest {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(AccountingPersistenceQueryFactoryTest.class);
|
private static Logger logger = LoggerFactory.getLogger(AccountingPersistenceQueryFactoryTest.class);
|
||||||
|
|
||||||
protected AccountingPersistenceBackendQuery apq;
|
protected AccountingPersistenceQuery apq;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void before() throws NoAvailableScopeException, NoUsableAccountingPersistenceQueryFound{
|
public void before() throws NoAvailableScopeException, NoUsableAccountingPersistenceQueryFound{
|
||||||
apq = AccountingPersistenceBackendQueryFactory.getInstance();
|
apq = AccountingPersistenceQueryFactory.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -52,7 +53,7 @@ public class AccountingPersistenceQueryFactoryTest extends ScopedTest {
|
||||||
Calendar endTime = Calendar.getInstance();
|
Calendar endTime = Calendar.getInstance();
|
||||||
TemporalConstraint temporalConstraint = new TemporalConstraint(startTime.getTimeInMillis(), endTime.getTimeInMillis(), AggregationMode.SECONDLY);
|
TemporalConstraint temporalConstraint = new TemporalConstraint(startTime.getTimeInMillis(), endTime.getTimeInMillis(), AggregationMode.SECONDLY);
|
||||||
List<Filter> filters = null;
|
List<Filter> filters = null;
|
||||||
Map<Calendar, Info> infos = AccountingPersistenceQuery.getTimeSeries(AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
Map<Calendar, Info> infos = apq.getTimeSeries(AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
||||||
Assert.assertTrue(infos!=null);
|
Assert.assertTrue(infos!=null);
|
||||||
for(Info info : infos.values()){
|
for(Info info : infos.values()){
|
||||||
logger.debug(info.toString());
|
logger.debug(info.toString());
|
||||||
|
@ -66,7 +67,8 @@ public class AccountingPersistenceQueryFactoryTest extends ScopedTest {
|
||||||
Calendar endTime = Calendar.getInstance();
|
Calendar endTime = Calendar.getInstance();
|
||||||
TemporalConstraint temporalConstraint = new TemporalConstraint(startTime.getTimeInMillis(), endTime.getTimeInMillis(), AggregationMode.SECONDLY);
|
TemporalConstraint temporalConstraint = new TemporalConstraint(startTime.getTimeInMillis(), endTime.getTimeInMillis(), AggregationMode.SECONDLY);
|
||||||
List<Filter> filters = new ArrayList<Filter>();
|
List<Filter> filters = new ArrayList<Filter>();
|
||||||
Map<Calendar, Info> infos = AccountingPersistenceQuery.getTimeSeries(AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
Class<? extends AggregatedRecord<?,?>> clz = AggregatedServiceUsageRecord.class;
|
||||||
|
Map<Calendar, Info> infos = apq.getTimeSeries(AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
||||||
Assert.assertTrue(infos!=null);
|
Assert.assertTrue(infos!=null);
|
||||||
for(Info info : infos.values()){
|
for(Info info : infos.values()){
|
||||||
logger.debug(info.toString());
|
logger.debug(info.toString());
|
||||||
|
@ -81,7 +83,7 @@ public class AccountingPersistenceQueryFactoryTest extends ScopedTest {
|
||||||
TemporalConstraint temporalConstraint = new TemporalConstraint(startTime.getTimeInMillis(), endTime.getTimeInMillis(), AggregationMode.SECONDLY);
|
TemporalConstraint temporalConstraint = new TemporalConstraint(startTime.getTimeInMillis(), endTime.getTimeInMillis(), AggregationMode.SECONDLY);
|
||||||
List<Filter> filters = new ArrayList<Filter>();
|
List<Filter> filters = new ArrayList<Filter>();
|
||||||
filters.add(new Filter("AUX", "AUX"));
|
filters.add(new Filter("AUX", "AUX"));
|
||||||
AccountingPersistenceQuery.getTimeSeries(AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
apq.getTimeSeries(AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,7 +95,7 @@ public class AccountingPersistenceQueryFactoryTest extends ScopedTest {
|
||||||
TemporalConstraint temporalConstraint = new TemporalConstraint(startTime.getTimeInMillis(), endTime.getTimeInMillis(), AggregationMode.SECONDLY);
|
TemporalConstraint temporalConstraint = new TemporalConstraint(startTime.getTimeInMillis(), endTime.getTimeInMillis(), AggregationMode.SECONDLY);
|
||||||
List<Filter> filters = new ArrayList<Filter>();
|
List<Filter> filters = new ArrayList<Filter>();
|
||||||
filters.add(new Filter(ServiceUsageRecord.SERVICE_CLASS, "AUX"));
|
filters.add(new Filter(ServiceUsageRecord.SERVICE_CLASS, "AUX"));
|
||||||
Map<Calendar, Info> infos = AccountingPersistenceQuery.getTimeSeries(AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
Map<Calendar, Info> infos = apq.getTimeSeries(AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
||||||
Assert.assertTrue(infos!=null);
|
Assert.assertTrue(infos!=null);
|
||||||
Assert.assertTrue(infos.isEmpty());
|
Assert.assertTrue(infos.isEmpty());
|
||||||
}
|
}
|
||||||
|
@ -110,7 +112,7 @@ public class AccountingPersistenceQueryFactoryTest extends ScopedTest {
|
||||||
TemporalConstraint temporalConstraint = new TemporalConstraint(startTime.getTimeInMillis(), endTime.getTimeInMillis(), AggregationMode.SECONDLY);
|
TemporalConstraint temporalConstraint = new TemporalConstraint(startTime.getTimeInMillis(), endTime.getTimeInMillis(), AggregationMode.SECONDLY);
|
||||||
List<Filter> filters = new ArrayList<Filter>();
|
List<Filter> filters = new ArrayList<Filter>();
|
||||||
filters.add(new Filter(ServiceUsageRecord.SERVICE_CLASS, TestUsageRecord.TEST_SERVICE_CLASS));
|
filters.add(new Filter(ServiceUsageRecord.SERVICE_CLASS, TestUsageRecord.TEST_SERVICE_CLASS));
|
||||||
Map<Calendar, Info> infos = AccountingPersistenceQuery.getTimeSeries(AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
Map<Calendar, Info> infos = apq.getTimeSeries(AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
||||||
Assert.assertTrue(infos!=null);
|
Assert.assertTrue(infos!=null);
|
||||||
Assert.assertTrue(!infos.isEmpty());
|
Assert.assertTrue(!infos.isEmpty());
|
||||||
for(Info info : infos.values()){
|
for(Info info : infos.values()){
|
||||||
|
@ -119,7 +121,7 @@ public class AccountingPersistenceQueryFactoryTest extends ScopedTest {
|
||||||
|
|
||||||
filters = new ArrayList<Filter>();
|
filters = new ArrayList<Filter>();
|
||||||
filters.add(new Filter(StorageUsageRecord.RESOURCE_OWNER, TestUsageRecord.TEST_RESOUCE_OWNER));
|
filters.add(new Filter(StorageUsageRecord.RESOURCE_OWNER, TestUsageRecord.TEST_RESOUCE_OWNER));
|
||||||
infos = AccountingPersistenceQuery.getTimeSeries(AggregatedStorageUsageRecord.class, temporalConstraint, filters);
|
infos = apq.getTimeSeries(AggregatedStorageUsageRecord.class, temporalConstraint, filters);
|
||||||
Assert.assertTrue(infos!=null);
|
Assert.assertTrue(infos!=null);
|
||||||
Assert.assertTrue(!infos.isEmpty());
|
Assert.assertTrue(!infos.isEmpty());
|
||||||
for(Info info : infos.values()){
|
for(Info info : infos.values()){
|
||||||
|
@ -157,7 +159,7 @@ public class AccountingPersistenceQueryFactoryTest extends ScopedTest {
|
||||||
filters.add(new Filter(UsageRecord.CONSUMER_ID, "gianpaolo.coro"));
|
filters.add(new Filter(UsageRecord.CONSUMER_ID, "gianpaolo.coro"));
|
||||||
|
|
||||||
AccountingPersistenceBackendQuery apq = AccountingPersistenceBackendQueryFactory.getInstance();
|
AccountingPersistenceBackendQuery apq = AccountingPersistenceBackendQueryFactory.getInstance();
|
||||||
Map<Calendar, Info> infos = apq.query(AggregatedStorageUsageRecord.class, temporalConstraint, filters);
|
Map<Calendar, Info> infos = apq.getTimeSeries(AggregatedStorageUsageRecord.class, temporalConstraint, filters);
|
||||||
Assert.assertTrue(infos!=null);
|
Assert.assertTrue(infos!=null);
|
||||||
Assert.assertTrue(!infos.isEmpty());
|
Assert.assertTrue(!infos.isEmpty());
|
||||||
|
|
||||||
|
@ -165,7 +167,7 @@ public class AccountingPersistenceQueryFactoryTest extends ScopedTest {
|
||||||
logger.debug(info.toString());
|
logger.debug(info.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceRecordQuery resourceRecordQuery = new ResourceRecordQuery();
|
resourceRecordQuery resourceRecordQuery = new ResourceRecordQuery();
|
||||||
List<Info> padded = resourceRecordQuery.getInfo(AggregatedStorageUsageRecord.class, temporalConstraint, filters, true);
|
List<Info> padded = resourceRecordQuery.getInfo(AggregatedStorageUsageRecord.class, temporalConstraint, filters, true);
|
||||||
Assert.assertTrue(padded!=null);
|
Assert.assertTrue(padded!=null);
|
||||||
Assert.assertTrue(!padded.isEmpty());
|
Assert.assertTrue(!padded.isEmpty());
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class AccountingPersistenceQueryCouchDBTest extends ScopedTest {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(AccountingPersistenceQueryCouchDBTest.class);
|
private static Logger logger = LoggerFactory.getLogger(AccountingPersistenceQueryCouchDBTest.class);
|
||||||
|
|
||||||
protected AccountingPersistenceQueryCouchDB accountingPersistenceQueryCouchDBNew;
|
protected AccountingPersistenceQueryCouchDB accountingPersistenceQueryCouchDB;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void before() throws Exception{
|
public void before() throws Exception{
|
||||||
|
@ -45,8 +45,8 @@ public class AccountingPersistenceQueryCouchDBTest extends ScopedTest {
|
||||||
String url = configuration.getProperty(AccountingPersistenceQueryCouchDB.URL_PROPERTY_KEY);
|
String url = configuration.getProperty(AccountingPersistenceQueryCouchDB.URL_PROPERTY_KEY);
|
||||||
url = url.replace("accounting-d-d4s.d4science.org", "couchdb01-d-d4s.d4science.org:5984");
|
url = url.replace("accounting-d-d4s.d4science.org", "couchdb01-d-d4s.d4science.org:5984");
|
||||||
configuration.addProperty(AccountingPersistenceQueryCouchDB.URL_PROPERTY_KEY, url);
|
configuration.addProperty(AccountingPersistenceQueryCouchDB.URL_PROPERTY_KEY, url);
|
||||||
accountingPersistenceQueryCouchDBNew = new AccountingPersistenceQueryCouchDB();
|
accountingPersistenceQueryCouchDB = new AccountingPersistenceQueryCouchDB();
|
||||||
accountingPersistenceQueryCouchDBNew.prepareConnection(configuration);
|
accountingPersistenceQueryCouchDB.prepareConnection(configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <V> String printCalendarMap(Map<Calendar, V> map){
|
public static <V> String printCalendarMap(Map<Calendar, V> map){
|
||||||
|
@ -92,21 +92,21 @@ public class AccountingPersistenceQueryCouchDBTest extends ScopedTest {
|
||||||
AggregatedServiceUsageRecord.class;
|
AggregatedServiceUsageRecord.class;
|
||||||
|
|
||||||
Map<NumberedFilter, SortedMap<Calendar, Info>> map =
|
Map<NumberedFilter, SortedMap<Calendar, Info>> map =
|
||||||
accountingPersistenceQueryCouchDBNew.getTopValues(clz,
|
accountingPersistenceQueryCouchDB.getTopValues(clz,
|
||||||
temporalConstraint, filters);
|
temporalConstraint, filters);
|
||||||
|
|
||||||
logger.debug("Top Query Results :\n{}", printMap(map));
|
logger.debug("Top Query Results :\n{}", printMap(map));
|
||||||
|
|
||||||
|
|
||||||
SortedSet<NumberedFilter> possibleValues =
|
SortedSet<NumberedFilter> possibleValues =
|
||||||
accountingPersistenceQueryCouchDBNew.getNextPossibleValues(clz,
|
accountingPersistenceQueryCouchDB.getNextPossibleValues(clz,
|
||||||
temporalConstraint, filters);
|
temporalConstraint, filters);
|
||||||
|
|
||||||
logger.debug("Possibile Values :\n{}", possibleValues);
|
logger.debug("Possibile Values :\n{}", possibleValues);
|
||||||
|
|
||||||
filter.setValue("UNKNOWN");
|
filter.setValue("UNKNOWN");
|
||||||
SortedMap<Calendar, Info> timeSeries =
|
SortedMap<Calendar, Info> timeSeries =
|
||||||
accountingPersistenceQueryCouchDBNew.getTimeSeries(clz,
|
accountingPersistenceQueryCouchDB.getTimeSeries(clz,
|
||||||
temporalConstraint, filters);
|
temporalConstraint, filters);
|
||||||
|
|
||||||
logger.debug("Time Series for {}:\n{}", filter,
|
logger.debug("Time Series for {}:\n{}", filter,
|
||||||
|
|
|
@ -9,7 +9,6 @@ import org.ektorp.ViewQuery;
|
||||||
import org.ektorp.ViewResult;
|
import org.ektorp.ViewResult;
|
||||||
import org.gcube.accounting.analytics.persistence.AccountingPersistenceBackendQueryConfiguration;
|
import org.gcube.accounting.analytics.persistence.AccountingPersistenceBackendQueryConfiguration;
|
||||||
import org.gcube.testutility.ScopedTest;
|
import org.gcube.testutility.ScopedTest;
|
||||||
import org.junit.Test;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ public class CouchDBQueryPluginTest extends ScopedTest {
|
||||||
AccountingPersistenceFactory.initAccountingPackages();
|
AccountingPersistenceFactory.initAccountingPackages();
|
||||||
Map<String, Object> inputs = new HashMap<String, Object>();
|
Map<String, Object> inputs = new HashMap<String, Object>();
|
||||||
inputs.put(CouchDBQueryPlugin.DELAY_MILLIS, 1000*10); // Delay 10 sec
|
inputs.put(CouchDBQueryPlugin.DELAY_MILLIS, 1000*10); // Delay 10 sec
|
||||||
|
inputs.put(CouchDBQueryPlugin.MAX_RETRY_NUMBER, 0); // No Retry
|
||||||
CouchDBQueryPlugin couchDBQueryPlugin = new CouchDBQueryPlugin(null);
|
CouchDBQueryPlugin couchDBQueryPlugin = new CouchDBQueryPlugin(null);
|
||||||
couchDBQueryPlugin.launch(inputs);
|
couchDBQueryPlugin.launch(inputs);
|
||||||
logger.debug("-------------- launch test finished");
|
logger.debug("-------------- launch test finished");
|
||||||
|
|
|
@ -12,10 +12,8 @@ import java.util.Calendar;
|
||||||
|
|
||||||
import org.gcube.accounting.persistence.AccountingPersistence;
|
import org.gcube.accounting.persistence.AccountingPersistence;
|
||||||
import org.gcube.accounting.persistence.AccountingPersistenceFactory;
|
import org.gcube.accounting.persistence.AccountingPersistenceFactory;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
|
||||||
import org.gcube.testutility.ScopedTest;
|
import org.gcube.testutility.ScopedTest;
|
||||||
import org.gcube.testutility.TestUsageRecord;
|
import org.gcube.testutility.TestUsageRecord;
|
||||||
import org.gcube.testutility.TestUtility;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue