37 lines
1.2 KiB
Java
37 lines
1.2 KiB
Java
/**
|
|
*
|
|
*/
|
|
package org.gcube.accounting.datamodel.implementation;
|
|
|
|
import org.gcube.accounting.datamodel.implementations.ServiceUsageRecord;
|
|
import org.gcube.accounting.exception.InvalidValueException;
|
|
import org.gcube.accounting.persistence.Persistence;
|
|
import org.junit.Test;
|
|
|
|
/**
|
|
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
|
*
|
|
*/
|
|
public class ServiceUsageRecordTest {
|
|
|
|
@Test
|
|
public void exampleTest() throws InvalidValueException {
|
|
Persistence.setFallbackLocation(System.getProperty("user.home"));
|
|
Persistence persistence = Persistence.getInstance();
|
|
|
|
ServiceUsageRecord serviceUsageRecord = new ServiceUsageRecord();
|
|
serviceUsageRecord.setCreatorId("luca.frosini");
|
|
serviceUsageRecord.setConsumerId("accounting");
|
|
serviceUsageRecord.setResourceScope("/gcube/devsec");
|
|
serviceUsageRecord.setServiceClass("Accounting");
|
|
serviceUsageRecord.setServiceName("Accounting-Lib");
|
|
serviceUsageRecord.setRefHost("localhost");
|
|
serviceUsageRecord.setRefVM("local");
|
|
serviceUsageRecord.setCallerScope("/gcube/devsec");
|
|
|
|
serviceUsageRecord.setResourceProperty("ConnectionTest", "Test");
|
|
|
|
persistence.account(serviceUsageRecord);
|
|
}
|
|
}
|