Search in sources :

Example 1 with Process

use of org.openlca.ilcd.processes.Process in project olca-modules by GreenDelta.

the class WrapperTest method testExchanges.

@Test
public void testExchanges() {
    InputStream in = getClass().getResourceAsStream("sdk_sample_process.xml");
    Process p = JAXB.unmarshal(in, Process.class);
    Assert.assertEquals(2, p.exchanges.size());
    Assert.assertEquals(2, p.lciaResults.length);
}
Also used : InputStream(java.io.InputStream) Process(org.openlca.ilcd.processes.Process) Test(org.junit.Test)

Example 2 with Process

use of org.openlca.ilcd.processes.Process in project olca-modules by GreenDelta.

the class XmlBinderTest method makeProcess.

private Process makeProcess() {
    Process process = new Process();
    ProcessInfo pi = new ProcessInfo();
    DataSetInfo info = new DataSetInfo();
    process.processInfo = pi;
    pi.dataSetInfo = info;
    info.uuid = UUID.randomUUID().toString();
    return process;
}
Also used : Process(org.openlca.ilcd.processes.Process) ProcessInfo(org.openlca.ilcd.processes.ProcessInfo) DataSetInfo(org.openlca.ilcd.processes.DataSetInfo)

Example 3 with Process

use of org.openlca.ilcd.processes.Process in project olca-modules by GreenDelta.

the class ProcessBagTest method setUp.

@Before
public void setUp() throws Exception {
    try (InputStream stream = this.getClass().getResourceAsStream("process.xml")) {
        XmlBinder binder = new XmlBinder();
        Process process = binder.fromStream(Process.class, stream);
        bag = new ProcessBag(process, "en");
    }
}
Also used : ProcessBag(org.openlca.ilcd.util.ProcessBag) InputStream(java.io.InputStream) Process(org.openlca.ilcd.processes.Process) Before(org.junit.Before)

Example 4 with Process

use of org.openlca.ilcd.processes.Process in project olca-modules by GreenDelta.

the class ILCDImportExportTest method testF_Process.

@Test
public void testF_Process() {
    String id = "76d6aaa4-37e2-40b2-994c-03292b600074";
    var dataSet = importConf.store().get(Process.class, id);
    var process = new ProcessImport(importConf).run(dataSet);
    assertEquals(id, process.refId);
    new ProcessExport(exportConf).run(process);
    assertTrue(exportConf.store.contains(Process.class, id));
}
Also used : ProcessImport(org.openlca.io.ilcd.input.ProcessImport) Process(org.openlca.ilcd.processes.Process) ProcessExport(org.openlca.io.ilcd.output.ProcessExport) Test(org.junit.Test)

Example 5 with Process

use of org.openlca.ilcd.processes.Process in project olca-modules by GreenDelta.

the class RefTreeTest method testFlowRef.

@Test
public void testFlowRef() {
    Process p = new Process();
    Exchange e = new Exchange();
    p.exchanges.add(e);
    Ref flowRef = new Ref();
    flowRef.uuid = "123";
    e.flow = flowRef;
    RefTree tree = RefTree.create(p);
    assertEquals(1, tree.root.childs.size());
    Ref ref = tree.getRefs().get(0);
    assertEquals("123", ref.uuid);
}
Also used : Exchange(org.openlca.ilcd.processes.Exchange) Ref(org.openlca.ilcd.commons.Ref) Process(org.openlca.ilcd.processes.Process) ProcessSampleTest(org.openlca.ilcd.io.ProcessSampleTest) Test(org.junit.Test)

Aggregations

Process (org.openlca.ilcd.processes.Process)11 Test (org.junit.Test)7 InputStream (java.io.InputStream)4 ProcessSampleTest (org.openlca.ilcd.io.ProcessSampleTest)3 Ref (org.openlca.ilcd.commons.Ref)2 ProcessBag (org.openlca.ilcd.util.ProcessBag)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 Before (org.junit.Before)1 DataSetInfo (org.openlca.ilcd.processes.DataSetInfo)1 Exchange (org.openlca.ilcd.processes.Exchange)1 ProcessInfo (org.openlca.ilcd.processes.ProcessInfo)1 ProcessImport (org.openlca.io.ilcd.input.ProcessImport)1 ProcessExport (org.openlca.io.ilcd.output.ProcessExport)1