use of org.openlca.ilcd.sources.DataSetInfo in project olca-modules by GreenDelta.
the class NetworkPutSourceTest method makeDataInfo.
private DataSetInfo makeDataInfo(String id) {
DataSetInfo info = new DataSetInfo();
String name = "xtest Source - " + new Random().nextInt(1000);
LangString.set(info.name, name, "en");
info.uuid = id;
return info;
}
use of org.openlca.ilcd.sources.DataSetInfo in project olca-modules by GreenDelta.
the class SourceBag method getExternalFileURIs.
public List<String> getExternalFileURIs() {
DataSetInfo info = getDataSetInformation();
if (info == null)
return Collections.emptyList();
List<FileRef> refs = info.files;
List<String> uris = new ArrayList<>();
for (FileRef ref : refs) {
if (ref.uri != null)
uris.add(ref.uri);
}
return uris;
}
use of org.openlca.ilcd.sources.DataSetInfo 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.DataSetInfo 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));
}
use of org.openlca.ilcd.sources.DataSetInfo in project olca-modules by GreenDelta.
the class SampleSource method makeDataInfo.
private static DataSetInfo makeDataInfo() {
String id = UUID.randomUUID().toString();
DataSetInfo info = new DataSetInfo();
LangString.set(info.name, "test source", "en");
info.uuid = id;
return info;
}
Aggregations