use of org.openlca.ilcd.sources.Source in project olca-modules by GreenDelta.
the class SourceWithFileTest method makeSource.
private Source makeSource(String id) {
Source source = SampleSource.create();
source.sourceInfo.dataSetInfo.uuid = id;
return source;
}
use of org.openlca.ilcd.sources.Source in project olca-modules by GreenDelta.
the class SourceWithFileTest method testSimpleSourceUpload.
@Test
public void testSimpleSourceUpload() {
Assume.assumeTrue(TestServer.isAvailable());
String id = UUID.randomUUID().toString();
Source source = makeSource(id);
client.put(source);
Source fromServer = client.get(Source.class, id);
assertEquals(id, fromServer.sourceInfo.dataSetInfo.uuid);
}
use of org.openlca.ilcd.sources.Source in project olca-modules by GreenDelta.
the class ILCDImportExportTest method testB_Source.
@Test
public void testB_Source() {
var id = "2c699413-f88b-4cb5-a56d-98cb4068472f";
var dataSet = importConf.store().get(Source.class, id);
var source = new SourceImport(importConf).run(dataSet);
assertEquals(id, source.refId);
new SourceExport(exportConf).run(source);
assertTrue(exportConf.store.contains(Source.class, id));
}
use of org.openlca.ilcd.sources.Source in project olca-modules by GreenDelta.
the class DataSets method putSource.
private static void putSource(SodaClient client) throws Exception {
Source source = load(Source.class, "source.xml");
SourceBag bag = new SourceBag(source, "en");
if (!client.contains(Source.class, bag.getId()))
client.put(source);
}
use of org.openlca.ilcd.sources.Source in project olca-modules by GreenDelta.
the class NetworkGetTest method testGetSource.
@Test
public void testGetSource() {
Assume.assumeTrue(TestServer.isAvailable());
String id = "2c699413-f88b-4cb5-a56d-98cb4068472f";
Source source = client.get(Source.class, id);
assertEquals(id, source.sourceInfo.dataSetInfo.uuid);
testContains(Source.class, id);
}
Aggregations