use of org.openlca.core.model.ModelType in project olca-modules by GreenDelta.
the class FileStore method deleteFolder.
public void deleteFolder(RefEntity e) {
if (e == null)
return;
ModelType type = ModelType.forModelClass(e.getClass());
deleteFolder(type, e.refId);
}
use of org.openlca.core.model.ModelType in project olca-modules by GreenDelta.
the class FileStore method copyFolder.
public void copyFolder(RefEntity from, RefEntity to) {
if (from == null || to == null)
return;
ModelType type = ModelType.forModelClass(from.getClass());
copyFolder(type, from.refId, to.refId);
}
use of org.openlca.core.model.ModelType in project olca-modules by GreenDelta.
the class BaseReferenceSearchTest method findReferences.
protected List<Reference> findReferences(Set<Long> ids) {
ModelType type = getModelType();
IReferenceSearch<?> search = IReferenceSearch.FACTORY.createFor(type, Tests.getDb(), true);
return search.findReferences(ids);
}
use of org.openlca.core.model.ModelType in project olca-modules by GreenDelta.
the class CategoryDaoTest method findAllRootTypes.
@Test
public void findAllRootTypes() {
// in categories, but this test should work
for (ModelType type : ModelType.values()) {
Category cat = create();
cat.modelType = type;
dao.insert(cat);
Tests.emptyCache();
List<Category> categories = dao.getRootCategories(type);
Assert.assertTrue(categories.contains(cat));
dao.delete(cat);
categories = dao.getRootCategories(type);
Assert.assertFalse(categories.contains(cat));
}
}
use of org.openlca.core.model.ModelType in project olca-modules by GreenDelta.
the class EnumsTest method testModelType.
@Test
public void testModelType() {
ModelType type = Enums.getValue("FLOW", ModelType.class);
assertEquals(ModelType.FLOW, type);
assertEquals("FLOW", Enums.getLabel(type));
}
Aggregations