use of org.openlca.jsonld.output.JsonExport in project olca-modules by GreenDelta.
the class ParameterTest method testImpactCategory.
@Test
public void testImpactCategory() {
var impact = new ImpactCategory();
impact.refId = UUID.randomUUID().toString();
var param = impact.parameter("param", 42);
var dao = new ImpactCategoryDao(Tests.getDb());
dao.insert(impact);
with(zip -> {
JsonExport export = new JsonExport(Tests.getDb(), zip);
export.write(impact);
});
dao.delete(impact);
with(zip -> {
JsonImport jImport = new JsonImport(zip, Tests.getDb());
jImport.run();
});
ImpactCategory clone = dao.getForRefId(impact.refId);
Assert.assertEquals(param.refId, clone.parameters.get(0).refId);
}
use of org.openlca.jsonld.output.JsonExport in project olca-modules by GreenDelta.
the class SocialIndicatorTest method doExport.
private void doExport(SocialIndicator indicator, SocialIndicatorDao dao) {
with(zip -> {
JsonExport export = new JsonExport(Tests.getDb(), zip);
export.write(indicator);
});
dao.delete(indicator);
Assert.assertFalse(dao.contains(indicator.refId));
}
use of org.openlca.jsonld.output.JsonExport in project olca-modules by GreenDelta.
the class SourceTest method doExport.
private void doExport(Source source, SourceDao dao) {
with(zip -> {
JsonExport export = new JsonExport(Tests.getDb(), zip);
export.write(source);
});
dao.delete(source);
Assert.assertFalse(dao.contains(source.refId));
}
use of org.openlca.jsonld.output.JsonExport in project olca-modules by GreenDelta.
the class UnitGroupTest method doExport.
private void doExport(UnitGroup group, UnitGroupDao dao) {
with(zip -> {
JsonExport export = new JsonExport(Tests.getDb(), zip);
export.write(group);
});
dao.delete(group);
Assert.assertFalse(dao.contains(group.refId));
}
use of org.openlca.jsonld.output.JsonExport in project olca-modules by GreenDelta.
the class ActorTest method doExport.
private void doExport(Actor actor, ActorDao dao) {
with(zip -> {
JsonExport export = new JsonExport(Tests.getDb(), zip);
export.write(actor);
});
dao.delete(actor);
Assert.assertFalse(dao.contains(actor.refId));
}
Aggregations