use of org.openlca.ilcd.flows.Flow in project olca-modules by GreenDelta.
the class RefTreeTest method testFlowSample.
@Test
public void testFlowSample() {
InputStream is = ProcessSampleTest.class.getResourceAsStream("sdk_sample_flow.xml");
Flow p = JAXB.unmarshal(is, Flow.class);
RefTree tree = RefTree.create(p);
assertTrue(tree.getRefs().size() > 2);
}
use of org.openlca.ilcd.flows.Flow in project olca-modules by GreenDelta.
the class DataSets method putFlow.
private static void putFlow(SodaClient client) throws Exception {
Flow flow = load(Flow.class, "flow.xml");
FlowBag bag = new FlowBag(flow, "en");
if (!client.contains(Flow.class, bag.getId()))
client.put(flow);
}
use of org.openlca.ilcd.flows.Flow in project olca-modules by GreenDelta.
the class FlowUpdateTest method makeFlow.
private Flow makeFlow(String id) {
Flow flow = new Flow();
FlowInfo info = new FlowInfo();
flow.flowInfo = info;
DataSetInfo dataInfo = new DataSetInfo();
dataInfo.uuid = id;
info.dataSetInfo = dataInfo;
FlowName name = new FlowName();
dataInfo.name = name;
LangString.set(name.baseName, "test flow - " + id, "en");
AdminInfo adminInfo = new AdminInfo();
Publication pub = new Publication();
adminInfo.publication = pub;
pub.version = "01.00.000";
flow.adminInfo = adminInfo;
Modelling mav = new Modelling();
flow.modelling = mav;
LCIMethod method = new LCIMethod();
mav.lciMethod = method;
method.flowType = FlowType.ELEMENTARY_FLOW;
return flow;
}
use of org.openlca.ilcd.flows.Flow in project olca-modules by GreenDelta.
the class FlowUpdateTest method testPutFlow.
@Test
public void testPutFlow() {
Assume.assumeTrue(TestServer.isAvailable());
String id = UUID.randomUUID().toString();
Flow flow = makeFlow(id);
client.put(flow);
Assert.assertTrue(client.contains(Flow.class, id));
flow.adminInfo.publication.version = "02.00.000";
client.put(flow);
flow = client.get(Flow.class, id);
Assert.assertEquals("02.00.000", flow.adminInfo.publication.version);
}
use of org.openlca.ilcd.flows.Flow in project olca-modules by GreenDelta.
the class NetworkGetTest method testGetFlow.
@Test
public void testGetFlow() {
Assume.assumeTrue(TestServer.isAvailable());
String id = "0d7a3ad1-6556-11dd-ad8b-0800200c9a66";
Flow flow = client.get(Flow.class, id);
assertEquals(id, flow.flowInfo.dataSetInfo.uuid);
testContains(Flow.class, id);
}
Aggregations