use of org.openlca.ilcd.processes.Process in project olca-modules by GreenDelta.
the class ProcessReadWriteTest method testReadWrite.
@Test
public void testReadWrite() throws Exception {
Process process = new Process();
setNameAndComment(process);
createExchange(process);
XmlBinder binder = new XmlBinder();
byte[] bytes = binder.toByteArray(process);
process = binder.fromStream(Process.class, new ByteArrayInputStream(bytes));
Assert.assertEquals("process name", process.processInfo.dataSetInfo.name.name.get(0).value);
Assert.assertEquals("process description", process.processInfo.dataSetInfo.comment.get(0).value);
Assert.assertEquals(1, process.exchanges.size());
}
use of org.openlca.ilcd.processes.Process in project olca-modules by GreenDelta.
the class ProcessTypeTest method with.
private void with(Consumer<Process> fn) throws Exception {
try (InputStream xml = getClass().getResourceAsStream("sdk_sample_process.xml")) {
Process p = JAXB.unmarshal(xml, Process.class);
fn.accept(p);
}
}
use of org.openlca.ilcd.processes.Process in project olca-modules by GreenDelta.
the class DataSets method putProcess.
private static void putProcess(SodaClient client) throws Exception {
Process process = load(Process.class, "process.xml");
ProcessBag bag = new ProcessBag(process, "en");
if (!client.contains(Process.class, bag.getId()))
client.put(process);
}
use of org.openlca.ilcd.processes.Process in project olca-modules by GreenDelta.
the class NetworkGetTest method testGetProcess.
@Test
public void testGetProcess() {
Assume.assumeTrue(TestServer.isAvailable());
String id = "76d6aaa4-37e2-40b2-994c-03292b600074";
Process process = client.get(Process.class, id);
assertEquals(id, process.processInfo.dataSetInfo.uuid);
testContains(Process.class, id);
}
use of org.openlca.ilcd.processes.Process in project olca-modules by GreenDelta.
the class RefTreeTest method testNoRef.
@Test
public void testNoRef() {
Process p = new Process();
RefTree tree = RefTree.create(p);
assertTrue(tree.root.childs.isEmpty());
assertTrue(tree.getRefs().isEmpty());
}
Aggregations