Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
0709752f
Commit
0709752f
authored
Aug 13, 2020
by
Piotr Gawron
Browse files
complex name is escaped against xml characters
parent
33767395
Changes
2
Hide whitespace changes
Inline
Side-by-side
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ModelToGPML.java
View file @
0709752f
...
...
@@ -500,7 +500,7 @@ public class ModelToGPML {
for
(
Complex
ca
:
model
.
getComplexList
())
{
if
(
ca
.
getElements
().
size
()
==
0
)
{
dataNodes
.
append
(
" <DataNode TextLabel=\""
+
ca
.
getName
()
+
"\" GraphId=\""
+
ca
.
getElementId
()
+
"\" Type=\"Complex\""
);
" <DataNode TextLabel=\""
+
XmlParser
.
escapeXml
(
ca
.
getName
()
)
+
"\" GraphId=\""
+
ca
.
getElementId
()
+
"\" Type=\"Complex\""
);
if
(
ca
.
getComplex
()
!=
null
)
{
dataNodes
.
append
(
" GroupRef=\""
+
ca
.
getComplex
().
getElementId
()
+
"\""
);
}
...
...
pathvisio/src/test/java/lcsb/mapviewer/wikipathway/XML/ModelToGPMLTest.java
View file @
0709752f
...
...
@@ -331,6 +331,10 @@ public class ModelToGPMLTest extends WikipathwaysTestFunctions {
complex
.
setX
(
1
);
complex
.
setY
(
1
);
complex
.
setZ
(
15
);
complex
.
setNamePoint
(
6
,
9
);
complex
.
setNameVerticalAlign
(
VerticalAlign
.
BOTTOM
);
complex
.
setNameHorizontalAlign
(
HorizontalAlign
.
CENTER
);
complex
.
setHypothetical
(
true
);
return
complex
;
}
...
...
@@ -435,9 +439,9 @@ public class ModelToGPMLTest extends WikipathwaysTestFunctions {
model
.
setHeight
(
1000
);
return
model
;
}
@Test
public
void
specialCharacterInCom
a
prtmentName
()
throws
Exception
{
public
void
specialCharacterInComp
a
rtmentName
()
throws
Exception
{
Model
model
=
createModel
();
Compartment
compartment
=
createCompartment
();
compartment
.
setName
(
"hello&by"
);
...
...
@@ -447,4 +451,16 @@ public class ModelToGPMLTest extends WikipathwaysTestFunctions {
assertEquals
(
0
,
new
ModelComparator
().
compare
(
model
,
model2
));
}
@Test
public
void
specialCharacterInComplexName
()
throws
Exception
{
Model
model
=
createModel
();
Element
element
=
createComplex
();
element
.
setName
(
"hello&by"
);
model
.
addElement
(
element
);
Model
model2
=
serializeOverGpml
(
model
);
assertEquals
(
0
,
new
ModelComparator
().
compare
(
model
,
model2
));
}
}
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