Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
ce447a66
Commit
ce447a66
authored
Nov 05, 2019
by
Piotr Gawron
Browse files
export of model with invalid model id doesn't break export to sbml
parent
1deccb1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/SbmlExporter.java
View file @
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
()));
...
...
converter-sbml/src/test/java/lcsb/mapviewer/converter/model/sbml/SbmlExporterTest.java
View file @
ce447a66
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment