Skip to content
Snippets Groups Projects
Commit 7a25a141 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

export/import of model size added

parent 2d707314
No related branches found
No related tags found
1 merge request!186Resolve "upload of sbml"
......@@ -73,6 +73,10 @@ public class SbmlParser implements IConverter {
model.addReactions(reactionParser.parseList(sbmlModel));
if (layout != null) {
if (layout.getDimensions() != null) {
model.setWidth(layout.getDimensions().getWidth());
model.setHeight(layout.getDimensions().getHeight());
}
compartmentParser.mergeLayout(model.getCompartments(), layout, sbmlModel);
speciesParser.mergeLayout(model.getSpeciesList(), layout, sbmlModel);
reactionParser.mergeLayout(model.getReactions(), layout, sbmlModel);
......
......@@ -61,7 +61,7 @@ public class GenericSbmlToXmlParserTest {
converter.exportModelToFile(model, xmlFilePath);
Model model2 = converter.createModel(new ConverterParams().filename(xmlFilePath));
model.setName(null);
model2.setName(null);
assertNotNull(model2);
ModelComparator comparator = new ModelComparator(1.0);
......
......@@ -133,6 +133,17 @@ public class SbmlExporterTest {
assertEquals(model.getIdModel(), deserializedModel.getIdModel());
}
@Test
public void testExportModelDimension() throws Exception {
Model model = new ModelFullIndexed(null);
model.setWidth(200);
model.setHeight(300);
Model deserializedModel = getModelAfterSerializing(model);
assertEquals(model.getWidth(), deserializedModel.getWidth());
assertEquals(model.getHeight(), deserializedModel.getHeight());
}
@Test
public void testExportEmptyModel() throws Exception {
Model model = new ModelFullIndexed(null);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment