use of org.openlca.ilcd.sources.Source in project olca-modules by GreenDelta.
the class NetworkPutSourceTest method testPutSource.
@Test
public void testPutSource() throws Exception {
Assume.assumeTrue(TestServer.isAvailable());
String id = UUID.randomUUID().toString();
Source source = new Source();
SourceInfo info = new SourceInfo();
source.sourceInfo = info;
info.dataSetInfo = makeDataInfo(id);
source.adminInfo = makeAdminInfo();
client.put(source);
}
use of org.openlca.ilcd.sources.Source in project olca-modules by GreenDelta.
the class SourceBagTest method setUp.
@Before
public void setUp() throws Exception {
try (InputStream stream = this.getClass().getResourceAsStream("source.xml")) {
XmlBinder binder = new XmlBinder();
Source source = binder.fromStream(Source.class, stream);
bag = new SourceBag(source, "en");
}
}
use of org.openlca.ilcd.sources.Source in project olca-modules by GreenDelta.
the class XmlBinderTest method makeInstances.
@Before
public void makeInstances() {
instances.add(makeProcess());
instances.add(new Flow());
instances.add(new FlowProperty());
instances.add(new UnitGroup());
instances.add(new Source());
instances.add(new Contact());
}
use of org.openlca.ilcd.sources.Source in project olca-modules by GreenDelta.
the class ZipStoreTest method testWithSource.
@Test
public void testWithSource() throws Exception {
DataSetInfo info = new DataSetInfo();
info.uuid = UUID.randomUUID().toString();
Source source = SampleSource.create();
source.sourceInfo = new SourceInfo();
source.sourceInfo.dataSetInfo = info;
store.put(source);
assertTrue(store.contains(Source.class, source.getUUID()));
Source copy = store.get(Source.class, source.getUUID());
assertEquals(source.sourceInfo.dataSetInfo.uuid, copy.sourceInfo.dataSetInfo.uuid);
assertNotNull(store.iterator(Source.class).next());
}
use of org.openlca.ilcd.sources.Source in project olca-modules by GreenDelta.
the class FileStoreTest method testPut.
@Test
public void testPut() throws Exception {
DataSetInfo dataSetInfo = new DataSetInfo();
String id = UUID.randomUUID().toString();
dataSetInfo.uuid = id;
Source source = SampleSource.create();
source.sourceInfo = new SourceInfo();
source.sourceInfo.dataSetInfo = dataSetInfo;
fileStore.put(source);
assertTrue(fileStore.contains(Source.class, id));
}
Aggregations