Commit 0db0594e authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '938-gaps-in-reaction-lines-after-conversion-to-sbml-from-sbgn' into 'master'

Resolve "Gaps in reaction lines after conversion to SBML from SBGN"

Closes #938

See merge request minerva/core!997
parents 1deccb1f ce447a66
......@@ -73,7 +73,12 @@ public class SbmlExporter {
*/
protected SBMLDocument toSbmlDocument(lcsb.mapviewer.model.map.model.Model model) throws InconsistentModelException {
SBMLDocument doc = new SBMLDocument(3, 2);
Model result = doc.createModel(model.getIdModel());
Model result = doc.createModel();
try {
result.setId(model.getIdModel());
} catch (IllegalArgumentException e) {
logger.warn("Invalid model identifier: \"" + model.getIdModel() + "\". Ignoring.");
}
result.setName(model.getName());
try {
result.setNotes(NotesUtility.prepareEscapedXmlNotes(model.getNotes()));
......
......@@ -28,7 +28,7 @@ import lcsb.mapviewer.model.map.species.*;
import lcsb.mapviewer.model.map.species.field.*;
public class SbmlExporterTest extends SbmlTestFunctions {
Logger logger = LogManager.getLogger(SbmlExporterTest.class);
Logger logger = LogManager.getLogger();
ModelComparator comparator = new ModelComparator();
......@@ -612,4 +612,12 @@ public class SbmlExporterTest extends SbmlTestFunctions {
assertEquals(0, comparator.compare(model, originalModel));
}
@Test
public void testExportInvalidMapId() throws Exception {
Model originalModel = createEmptyModel();
originalModel.setIdModel("F006-ACLY-SBGNv02.sbgn");
String result = exporter.toXml(originalModel);
assertNotNull(result);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment