refs #2222: Move infrastructure tests outside of components junit tests
https://support.d4science.org/issues/2222 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/infrastructure-tests@124072 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4f15d5b3b0
commit
d0487f0ae0
|
@ -8,6 +8,7 @@ import java.net.URL;
|
||||||
import org.gcube.accounting.datamodel.basetypes.TestUsageRecord;
|
import org.gcube.accounting.datamodel.basetypes.TestUsageRecord;
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
import org.gcube.documentstore.records.Record;
|
import org.gcube.documentstore.records.Record;
|
||||||
|
import org.gcube.utils.TestUtility;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -37,7 +38,7 @@ public class PersistenceCouchBaseTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testJsonNodeUsageRecordConversions() throws Exception {
|
public void testJsonNodeUsageRecordConversions() throws Exception {
|
||||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||||
logger.debug("UsageRecord : {}", record.toString());
|
logger.debug("UsageRecord : {}", record.toString());
|
||||||
JsonNode node = PersistenceCouchBase.usageRecordToJsonNode(record);
|
JsonNode node = PersistenceCouchBase.usageRecordToJsonNode(record);
|
||||||
logger.debug("Node : {}", node.toString());
|
logger.debug("Node : {}", node.toString());
|
||||||
|
@ -48,7 +49,7 @@ public class PersistenceCouchBaseTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testJsonNodeUsageRecordConversionsWithNestedMap() throws Exception {
|
public void testJsonNodeUsageRecordConversionsWithNestedMap() throws Exception {
|
||||||
Record record = TestUsageRecord.createTestTaskUsageRecordAutomaticScope();
|
Record record = TestUsageRecord.createTestTaskUsageRecord();
|
||||||
logger.debug("UsageRecord : {}", record.toString());
|
logger.debug("UsageRecord : {}", record.toString());
|
||||||
JsonNode node = PersistenceCouchBase.usageRecordToJsonNode(record);
|
JsonNode node = PersistenceCouchBase.usageRecordToJsonNode(record);
|
||||||
logger.debug("Node : {}", node.toString());
|
logger.debug("Node : {}", node.toString());
|
||||||
|
@ -70,7 +71,7 @@ public class PersistenceCouchBaseTest {
|
||||||
PersistenceCouchBase couchBase = new PersistenceCouchBase();
|
PersistenceCouchBase couchBase = new PersistenceCouchBase();
|
||||||
couchBase.prepareConnection(persitenceConfiguration);
|
couchBase.prepareConnection(persitenceConfiguration);
|
||||||
|
|
||||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||||
couchBase.reallyAccount(record);
|
couchBase.reallyAccount(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class PersistenceCouchDBTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testJsonNodeUsageRecordConversions() throws Exception {
|
public void testJsonNodeUsageRecordConversions() throws Exception {
|
||||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||||
logger.debug("UsageRecord : {}", record.toString());
|
logger.debug("UsageRecord : {}", record.toString());
|
||||||
JsonNode node = PersistenceCouchDB.usageRecordToJsonNode(record);
|
JsonNode node = PersistenceCouchDB.usageRecordToJsonNode(record);
|
||||||
logger.debug("Node : {}", node.toString());
|
logger.debug("Node : {}", node.toString());
|
||||||
|
@ -48,7 +48,7 @@ public class PersistenceCouchDBTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testJsonNodeUsageRecordConversionsWithNestedMap() throws Exception {
|
public void testJsonNodeUsageRecordConversionsWithNestedMap() throws Exception {
|
||||||
Record record = TestUsageRecord.createTestTaskUsageRecordAutomaticScope();
|
Record record = TestUsageRecord.createTestTaskUsageRecord();
|
||||||
logger.debug("UsageRecord : {}", record.toString());
|
logger.debug("UsageRecord : {}", record.toString());
|
||||||
JsonNode node = PersistenceCouchDB.usageRecordToJsonNode(record);
|
JsonNode node = PersistenceCouchDB.usageRecordToJsonNode(record);
|
||||||
logger.debug("Node : {}", node.toString());
|
logger.debug("Node : {}", node.toString());
|
||||||
|
@ -77,7 +77,7 @@ public class PersistenceCouchDBTest {
|
||||||
PersistenceCouchDB couch = new PersistenceCouchDB();
|
PersistenceCouchDB couch = new PersistenceCouchDB();
|
||||||
couch.prepareConnection(persitenceConfiguration);
|
couch.prepareConnection(persitenceConfiguration);
|
||||||
|
|
||||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||||
couch.reallyAccount(record);
|
couch.reallyAccount(record);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.gcube.accounting.datamodel.basetypes.AbstractStorageUsageRecord.Opera
|
||||||
import org.gcube.accounting.datamodel.basetypes.TestUsageRecord;
|
import org.gcube.accounting.datamodel.basetypes.TestUsageRecord;
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
import org.gcube.documentstore.records.Record;
|
import org.gcube.documentstore.records.Record;
|
||||||
|
import org.gcube.utils.TestUtility;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -38,7 +39,7 @@ public class PersistenceMongoDBTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testJsonNodeUsageRecordConversions() throws Exception {
|
public void testJsonNodeUsageRecordConversions() throws Exception {
|
||||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||||
logger.debug("UsageRecord : {}", record.toString());
|
logger.debug("UsageRecord : {}", record.toString());
|
||||||
Document document = PersistenceMongoDB.usageRecordToDocument(record);
|
Document document = PersistenceMongoDB.usageRecordToDocument(record);
|
||||||
logger.debug("Document : {}", document.toString());
|
logger.debug("Document : {}", document.toString());
|
||||||
|
@ -49,7 +50,7 @@ public class PersistenceMongoDBTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testJsonNodeUsageRecordConversionsWithNestedMap() throws Exception {
|
public void testJsonNodeUsageRecordConversionsWithNestedMap() throws Exception {
|
||||||
Record record = TestUsageRecord.createTestTaskUsageRecordAutomaticScope();
|
Record record = TestUsageRecord.createTestTaskUsageRecord();
|
||||||
logger.debug("UsageRecord : {}", record.toString());
|
logger.debug("UsageRecord : {}", record.toString());
|
||||||
Document document = PersistenceMongoDB.usageRecordToDocument(record);
|
Document document = PersistenceMongoDB.usageRecordToDocument(record);
|
||||||
logger.debug("Document : {}", document.toString());
|
logger.debug("Document : {}", document.toString());
|
||||||
|
@ -76,15 +77,15 @@ public class PersistenceMongoDBTest {
|
||||||
mongo.prepareConnection(persitenceConfiguration);
|
mongo.prepareConnection(persitenceConfiguration);
|
||||||
|
|
||||||
|
|
||||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||||
record.setResourceProperty("Test", AUX.TESTER);
|
record.setResourceProperty("Test", AUX.TESTER);
|
||||||
mongo.reallyAccount(record);
|
mongo.reallyAccount(record);
|
||||||
|
|
||||||
record = TestUsageRecord.createTestStorageUsageRecordAutomaticScope();
|
record = TestUsageRecord.createTestStorageUsageRecord();
|
||||||
record.setResourceProperty("Test", AUX.TESTER);
|
record.setResourceProperty("Test", AUX.TESTER);
|
||||||
mongo.reallyAccount(record);
|
mongo.reallyAccount(record);
|
||||||
|
|
||||||
record = TestUsageRecord.createTestJobUsageRecordAutomaticScope();
|
record = TestUsageRecord.createTestJobUsageRecord();
|
||||||
mongo.reallyAccount(record);
|
mongo.reallyAccount(record);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory;
|
||||||
public class TestUtility {
|
public class TestUtility {
|
||||||
|
|
||||||
public static final String TOKEN = "";
|
public static final String TOKEN = "";
|
||||||
|
public static final String PARENT_TOKEN = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logger
|
* Logger
|
||||||
|
|
Loading…
Reference in New Issue