From 7d69ed0851a96063567c91c6afade28c31b0e5ff Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Thu, 2 Jul 2015 10:01:59 +0000 Subject: [PATCH] refs #200: Create accouting-lib library https://support.d4science.org/issues/200 Fixing tests git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@115779 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../accounting/datamodel/basetypes}/TestUsageRecord.java | 8 +++----- .../accounting/aggregation/ServiceUsageRecordTest.java | 2 +- .../aggregation/scheduler/AggregationSchedulerTest.java | 2 +- .../ServiceUsageRecordAggregationStrategyTest.java | 2 +- .../StorageUsageRecordAggregationStrategyTest.java | 2 +- .../org/gcube/accounting/datamodel/UsageRecordTest.java | 2 +- .../datamodel/usagerecords/ServiceUsageRecordTest.java | 2 +- .../org/gcube/accounting/persistence/PersistenceTest.java | 2 +- 8 files changed, 10 insertions(+), 12 deletions(-) rename src/{test/java/org/gcube/accounting/testutility => main/java/org/gcube/accounting/datamodel/basetypes}/TestUsageRecord.java (93%) diff --git a/src/test/java/org/gcube/accounting/testutility/TestUsageRecord.java b/src/main/java/org/gcube/accounting/datamodel/basetypes/TestUsageRecord.java similarity index 93% rename from src/test/java/org/gcube/accounting/testutility/TestUsageRecord.java rename to src/main/java/org/gcube/accounting/datamodel/basetypes/TestUsageRecord.java index b770fa7..b92cf39 100644 --- a/src/test/java/org/gcube/accounting/testutility/TestUsageRecord.java +++ b/src/main/java/org/gcube/accounting/datamodel/basetypes/TestUsageRecord.java @@ -1,7 +1,7 @@ /** * */ -package org.gcube.accounting.testutility; +package org.gcube.accounting.datamodel.basetypes; import java.net.URI; import java.net.URISyntaxException; @@ -10,8 +10,6 @@ import org.gcube.accounting.datamodel.UsageRecord.OperationResult; import org.gcube.accounting.datamodel.usagerecords.JobUsageRecord; import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord; import org.gcube.accounting.datamodel.usagerecords.StorageUsageRecord; -import org.gcube.accounting.datamodel.basetypes.StorageUsageRecord.DataType; -import org.gcube.accounting.datamodel.basetypes.StorageUsageRecord.OperationType; import org.gcube.accounting.exception.InvalidValueException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -101,8 +99,8 @@ public class TestUsageRecord { usageRecord.setResourceURI(new URI(TEST_RESOURCE_URI)); usageRecord.setProviderURI(new URI(TEST_PROVIDER_URI)); - usageRecord.setOperationType(OperationType.READ); - usageRecord.setDataType(DataType.STORAGE); + usageRecord.setOperationType(StorageUsageRecord.OperationType.READ); + usageRecord.setDataType(StorageUsageRecord.DataType.STORAGE); usageRecord.setDataVolume(generateRandomLong(MIN_DATA_VOLUME, MAX_DATA_VOLUME)); diff --git a/src/test/java/org/gcube/accounting/aggregation/ServiceUsageRecordTest.java b/src/test/java/org/gcube/accounting/aggregation/ServiceUsageRecordTest.java index 087b73d..adfb0a8 100644 --- a/src/test/java/org/gcube/accounting/aggregation/ServiceUsageRecordTest.java +++ b/src/test/java/org/gcube/accounting/aggregation/ServiceUsageRecordTest.java @@ -5,8 +5,8 @@ package org.gcube.accounting.aggregation; import java.util.Set; +import org.gcube.accounting.datamodel.basetypes.TestUsageRecord; import org.gcube.accounting.exception.InvalidValueException; -import org.gcube.accounting.testutility.TestUsageRecord; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; diff --git a/src/test/java/org/gcube/accounting/aggregation/scheduler/AggregationSchedulerTest.java b/src/test/java/org/gcube/accounting/aggregation/scheduler/AggregationSchedulerTest.java index 610adee..fdf170b 100644 --- a/src/test/java/org/gcube/accounting/aggregation/scheduler/AggregationSchedulerTest.java +++ b/src/test/java/org/gcube/accounting/aggregation/scheduler/AggregationSchedulerTest.java @@ -5,11 +5,11 @@ package org.gcube.accounting.aggregation.scheduler; import org.gcube.accounting.datamodel.SingleUsageRecord; import org.gcube.accounting.datamodel.UsageRecord; +import org.gcube.accounting.datamodel.basetypes.TestUsageRecord; import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord; import org.gcube.accounting.persistence.PersistenceExecutor; import org.gcube.accounting.testutility.StressTestUtility; import org.gcube.accounting.testutility.TestOperation; -import org.gcube.accounting.testutility.TestUsageRecord; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/test/java/org/gcube/accounting/aggregation/strategy/ServiceUsageRecordAggregationStrategyTest.java b/src/test/java/org/gcube/accounting/aggregation/strategy/ServiceUsageRecordAggregationStrategyTest.java index c36c853..7db4f02 100644 --- a/src/test/java/org/gcube/accounting/aggregation/strategy/ServiceUsageRecordAggregationStrategyTest.java +++ b/src/test/java/org/gcube/accounting/aggregation/strategy/ServiceUsageRecordAggregationStrategyTest.java @@ -4,10 +4,10 @@ package org.gcube.accounting.aggregation.strategy; import org.gcube.accounting.aggregation.strategy.ServiceUsageRecordAggregationStrategy; +import org.gcube.accounting.datamodel.basetypes.TestUsageRecord; import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord; import org.gcube.accounting.exception.InvalidValueException; import org.gcube.accounting.exception.NotAggregatableRecordsExceptions; -import org.gcube.accounting.testutility.TestUsageRecord; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; diff --git a/src/test/java/org/gcube/accounting/aggregation/strategy/StorageUsageRecordAggregationStrategyTest.java b/src/test/java/org/gcube/accounting/aggregation/strategy/StorageUsageRecordAggregationStrategyTest.java index dfff38e..070efc2 100644 --- a/src/test/java/org/gcube/accounting/aggregation/strategy/StorageUsageRecordAggregationStrategyTest.java +++ b/src/test/java/org/gcube/accounting/aggregation/strategy/StorageUsageRecordAggregationStrategyTest.java @@ -4,10 +4,10 @@ package org.gcube.accounting.aggregation.strategy; import org.gcube.accounting.aggregation.strategy.StorageUsageRecordAggregationStrategy; +import org.gcube.accounting.datamodel.basetypes.TestUsageRecord; import org.gcube.accounting.datamodel.usagerecords.StorageUsageRecord; import org.gcube.accounting.exception.InvalidValueException; import org.gcube.accounting.exception.NotAggregatableRecordsExceptions; -import org.gcube.accounting.testutility.TestUsageRecord; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; diff --git a/src/test/java/org/gcube/accounting/datamodel/UsageRecordTest.java b/src/test/java/org/gcube/accounting/datamodel/UsageRecordTest.java index a02d213..49ae7d8 100644 --- a/src/test/java/org/gcube/accounting/datamodel/UsageRecordTest.java +++ b/src/test/java/org/gcube/accounting/datamodel/UsageRecordTest.java @@ -3,8 +3,8 @@ */ package org.gcube.accounting.datamodel; +import org.gcube.accounting.datamodel.basetypes.TestUsageRecord; import org.gcube.accounting.exception.InvalidValueException; -import org.gcube.accounting.testutility.TestUsageRecord; import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/gcube/accounting/datamodel/usagerecords/ServiceUsageRecordTest.java b/src/test/java/org/gcube/accounting/datamodel/usagerecords/ServiceUsageRecordTest.java index c3109c7..07b8e0d 100644 --- a/src/test/java/org/gcube/accounting/datamodel/usagerecords/ServiceUsageRecordTest.java +++ b/src/test/java/org/gcube/accounting/datamodel/usagerecords/ServiceUsageRecordTest.java @@ -8,7 +8,7 @@ import java.util.Set; import org.gcube.accounting.datamodel.BasicUsageRecord; import org.gcube.accounting.datamodel.BasicUsageRecordUtility; -import org.gcube.accounting.testutility.TestUsageRecord; +import org.gcube.accounting.datamodel.basetypes.TestUsageRecord; import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/gcube/accounting/persistence/PersistenceTest.java b/src/test/java/org/gcube/accounting/persistence/PersistenceTest.java index b72c348..5f871c5 100644 --- a/src/test/java/org/gcube/accounting/persistence/PersistenceTest.java +++ b/src/test/java/org/gcube/accounting/persistence/PersistenceTest.java @@ -4,9 +4,9 @@ package org.gcube.accounting.persistence; import org.gcube.accounting.datamodel.SingleUsageRecord; +import org.gcube.accounting.datamodel.basetypes.TestUsageRecord; import org.gcube.accounting.testutility.StressTestUtility; import org.gcube.accounting.testutility.TestOperation; -import org.gcube.accounting.testutility.TestUsageRecord; import org.junit.Test; /**