use of org.openlca.core.model.FlowProperty in project olca-modules by GreenDelta.
the class FlowReferenceSearchTest method createFlowPropertyFactor.
private FlowPropertyFactor createFlowPropertyFactor() {
FlowPropertyFactor factor = new FlowPropertyFactor();
factor.flowProperty = db.insert(new FlowProperty());
return factor;
}
use of org.openlca.core.model.FlowProperty in project olca-modules by GreenDelta.
the class ImpactMethodReferenceSearchTest method createFlow.
private Flow createFlow() {
Flow flow = new Flow();
UnitGroup group = new UnitGroup();
Unit unit = new Unit();
unit.name = "unit";
group.units.add(unit);
group = db.insert(group);
FlowProperty property = new FlowProperty();
property.unitGroup = group;
property = db.insert(property);
FlowPropertyFactor factor = new FlowPropertyFactor();
factor.flowProperty = property;
flow.flowPropertyFactors.add(factor);
return db.insert(flow);
}
use of org.openlca.core.model.FlowProperty in project olca-modules by GreenDelta.
the class FlowDescriptorTest method setUp.
@Before
public void setUp() {
property = new FlowProperty();
property = new FlowPropertyDao(db).insert(property);
flow = new Flow();
flow.referenceFlowProperty = property;
flow = flowDao.insert(flow);
}
use of org.openlca.core.model.FlowProperty in project olca-modules by GreenDelta.
the class TestData method flow.
public static Flow flow(String name, String unit, FlowType type) {
String flowId = KeyGen.get("flow", name, unit);
FlowDao dao = new FlowDao(Tests.getDb());
Flow flow = dao.getForRefId(flowId);
if (flow != null)
return flow;
flow = new Flow();
flow.name = name;
flow.refId = flowId;
flow.flowType = type;
FlowProperty property = property(unit);
FlowPropertyFactor factor = new FlowPropertyFactor();
factor.flowProperty = property;
factor.conversionFactor = 1;
flow.flowPropertyFactors.add(factor);
flow.referenceFlowProperty = property;
return dao.insert(flow);
}
use of org.openlca.core.model.FlowProperty in project olca-modules by GreenDelta.
the class FlowPropertyFactorUseSearchTest method setup.
@Before
public void setup() {
flow = new Flow();
flow.name = "flow";
property = new FlowProperty();
property.name = "property";
factor = new FlowPropertyFactor();
factor.flowProperty = property;
flow.flowPropertyFactors.add(factor);
property = new FlowPropertyDao(database).insert(property);
flow = new FlowDao(database).insert(flow);
factor = flow.getFactor(property);
search = new FlowPropertyFactorUseSearch(flow, database);
}
Aggregations