16 #include "sbml/SBMLDocument.h"
17 #include "sbml/Model.h"
18 #include "sbml/xml/XMLNode.h"
39 CPPUNIT_ASSERT(pNotes != NULL);
40 CPPUNIT_ASSERT(pNotes->getName() ==
"body");
41 CPPUNIT_ASSERT(pNotes->getURI() ==
"http://www.w3.org/1999/xhtml");
42 CPPUNIT_ASSERT(pNotes->hasNamespaceURI(
"http://www.w3.org/1999/xhtml") ==
true);
43 CPPUNIT_ASSERT(pNotes->getNumChildren() == 1);
44 XMLNode* pChild = &pNotes->getChild(0);
45 CPPUNIT_ASSERT(pChild != NULL);
46 CPPUNIT_ASSERT(pChild->getName() ==
"pre");
47 CPPUNIT_ASSERT(pChild->getNumChildren() == 1);
48 pChild = &pChild->getChild(0);
49 CPPUNIT_ASSERT(pChild->isText());
50 CPPUNIT_ASSERT(pChild->getCharacters().find(
"This") != std::string::npos);
51 SBMLDocument *pDocument =
new SBMLDocument(2, 4);
52 CPPUNIT_ASSERT(pDocument != NULL);
53 Model* pModel = pDocument->createModel(
"test_model");
54 CPPUNIT_ASSERT(pModel != NULL);
55 int set_result = pModel->setNotes(pNotes);
56 CPPUNIT_ASSERT(set_result == LIBSBML_OPERATION_SUCCESS);
64 CPPUNIT_ASSERT(pNotes != NULL);
65 CPPUNIT_ASSERT(pNotes->getName() ==
"p");
66 CPPUNIT_ASSERT(pNotes->getURI() ==
"http://www.w3.org/1999/xhtml");
67 CPPUNIT_ASSERT(pNotes->hasNamespaceURI(
"http://www.w3.org/1999/xhtml") ==
true);
68 CPPUNIT_ASSERT(pNotes->getNumChildren() == 1);
69 XMLNode* pChild = &pNotes->getChild(0);
70 CPPUNIT_ASSERT(pChild != NULL);
71 CPPUNIT_ASSERT(pChild->isText());
72 CPPUNIT_ASSERT(pChild->getCharacters().find(
"This") != std::string::npos);
73 SBMLDocument *pDocument =
new SBMLDocument(2, 4);
74 CPPUNIT_ASSERT(pDocument != NULL);
75 Model* pModel = pDocument->createModel(
"test_model");
76 CPPUNIT_ASSERT(pModel != NULL);
77 int set_result = pModel->setNotes(pNotes);
78 CPPUNIT_ASSERT(set_result == LIBSBML_OPERATION_SUCCESS);
86 CPPUNIT_ASSERT(pNotes != NULL);
87 CPPUNIT_ASSERT(pNotes->getName() ==
"body");
88 CPPUNIT_ASSERT(pNotes->getURI() ==
"http://www.w3.org/1999/xhtml");
89 CPPUNIT_ASSERT(pNotes->hasNamespaceURI(
"http://www.w3.org/1999/xhtml") ==
true);
90 CPPUNIT_ASSERT(pNotes->getNumChildren() == 3);
91 XMLNode* pChild = &pNotes->getChild(0);
92 CPPUNIT_ASSERT(pChild != NULL);
93 CPPUNIT_ASSERT(pChild->isElement());
94 CPPUNIT_ASSERT(pChild->getName() ==
"p");
95 CPPUNIT_ASSERT(pChild->getNumChildren() == 1);
96 pChild = &pChild->getChild(0);
97 CPPUNIT_ASSERT(pChild != NULL);
98 CPPUNIT_ASSERT(pChild->isText());
99 CPPUNIT_ASSERT(pChild->getCharacters().find(
"This") != std::string::npos);
100 pChild = &pNotes->getChild(1);
101 CPPUNIT_ASSERT(pChild != NULL);
102 CPPUNIT_ASSERT(pChild->isElement());
103 CPPUNIT_ASSERT(pChild->getName() ==
"p");
104 CPPUNIT_ASSERT(pChild->getNumChildren() == 1);
105 pChild = &pChild->getChild(0);
106 CPPUNIT_ASSERT(pChild != NULL);
107 CPPUNIT_ASSERT(pChild->isText());
108 CPPUNIT_ASSERT(pChild->getCharacters().find(
"several") != std::string::npos);
109 pChild = &pNotes->getChild(2);
110 CPPUNIT_ASSERT(pChild != NULL);
111 CPPUNIT_ASSERT(pChild->isElement());
112 CPPUNIT_ASSERT(pChild->getName() ==
"p");
113 CPPUNIT_ASSERT(pChild->getNumChildren() == 1);
114 pChild = &pChild->getChild(0);
115 CPPUNIT_ASSERT(pChild != NULL);
116 CPPUNIT_ASSERT(pChild->isText());
117 CPPUNIT_ASSERT(pChild->getCharacters().find(
"correctly") != std::string::npos);
119 SBMLDocument *pDocument =
new SBMLDocument(2, 4);
120 CPPUNIT_ASSERT(pDocument != NULL);
121 Model* pModel = pDocument->createModel(
"test_model");
122 CPPUNIT_ASSERT(pModel != NULL);
123 int set_result = pModel->setNotes(pNotes);
124 CPPUNIT_ASSERT(set_result == LIBSBML_OPERATION_SUCCESS);
132 CPPUNIT_ASSERT(pNotes != NULL);
133 CPPUNIT_ASSERT(pNotes->getName() ==
"body");
134 CPPUNIT_ASSERT(pNotes->getURI() ==
"http://www.w3.org/1999/xhtml");
135 CPPUNIT_ASSERT(pNotes->hasNamespaceURI(
"http://www.w3.org/1999/xhtml") ==
true);
137 CPPUNIT_ASSERT(pNotes->getNumChildren() == 4);
138 XMLNode* pChild = &pNotes->getChild(0);
139 CPPUNIT_ASSERT(pChild != NULL);
140 CPPUNIT_ASSERT(pChild->isText());
141 CPPUNIT_ASSERT(pChild->getCharacters().find(
"This") != std::string::npos);
142 pChild = &pNotes->getChild(1);
143 CPPUNIT_ASSERT(pChild != NULL);
144 CPPUNIT_ASSERT(pChild->isElement());
145 CPPUNIT_ASSERT(pChild->getName() ==
"p");
146 CPPUNIT_ASSERT(pChild->getNumChildren() == 1);
147 pChild = &pChild->getChild(0);
148 CPPUNIT_ASSERT(pChild != NULL);
149 CPPUNIT_ASSERT(pChild->isText());
150 CPPUNIT_ASSERT(pChild->getCharacters().find(
"mixed") != std::string::npos);
151 pChild = &pNotes->getChild(2);
152 CPPUNIT_ASSERT(pChild != NULL);
153 CPPUNIT_ASSERT(pChild->isText());
154 CPPUNIT_ASSERT(pChild->getCharacters().find(
"paragraphs") != std::string::npos);
155 pChild = &pNotes->getChild(3);
156 CPPUNIT_ASSERT(pChild != NULL);
157 CPPUNIT_ASSERT(pChild->isElement());
158 CPPUNIT_ASSERT(pChild->getName() ==
"p");
159 CPPUNIT_ASSERT(pChild->getNumChildren() == 1);
160 pChild = &pChild->getChild(0);
161 CPPUNIT_ASSERT(pChild != NULL);
162 CPPUNIT_ASSERT(pChild->isText());
163 CPPUNIT_ASSERT(pChild->getCharacters().find(
"set ") != std::string::npos);
165 SBMLDocument *pDocument =
new SBMLDocument(2, 4);
166 CPPUNIT_ASSERT(pDocument != NULL);
167 Model* pModel = pDocument->createModel(
"test_model");
168 CPPUNIT_ASSERT(pModel != NULL);
169 int set_result = pModel->setNotes(pNotes);
170 CPPUNIT_ASSERT(set_result == LIBSBML_OPERATION_SUCCESS);
178 CPPUNIT_ASSERT(pNotes != NULL);
179 CPPUNIT_ASSERT(pNotes->getName() ==
"body");
180 CPPUNIT_ASSERT(pNotes->getURI() ==
"http://www.w3.org/1999/xhtml");
181 CPPUNIT_ASSERT(pNotes->hasNamespaceURI(
"http://www.w3.org/1999/xhtml") ==
true);
183 CPPUNIT_ASSERT(pNotes->getNumChildren() == 4);
184 XMLNode* pChild = &pNotes->getChild(0);
185 CPPUNIT_ASSERT(pChild != NULL);
186 CPPUNIT_ASSERT(pChild->isText());
187 CPPUNIT_ASSERT(pChild->getCharacters().find(
"This") != std::string::npos);
188 pChild = &pNotes->getChild(1);
189 CPPUNIT_ASSERT(pChild != NULL);
190 CPPUNIT_ASSERT(pChild->isElement());
191 CPPUNIT_ASSERT(pChild->getName() ==
"p");
192 CPPUNIT_ASSERT(pChild->getNumChildren() == 1);
193 pChild = &pChild->getChild(0);
194 CPPUNIT_ASSERT(pChild != NULL);
195 CPPUNIT_ASSERT(pChild->isText());
196 CPPUNIT_ASSERT(pChild->getCharacters().find(
"mixed") != std::string::npos);
197 pChild = &pNotes->getChild(2);
198 CPPUNIT_ASSERT(pChild != NULL);
199 CPPUNIT_ASSERT(pChild->isText());
200 CPPUNIT_ASSERT(pChild->getCharacters().find(
"paragraphs") != std::string::npos);
201 pChild = &pNotes->getChild(3);
202 CPPUNIT_ASSERT(pChild != NULL);
203 CPPUNIT_ASSERT(pChild->isElement());
204 CPPUNIT_ASSERT(pChild->getName() ==
"p");
205 CPPUNIT_ASSERT(pChild->getNumChildren() == 1);
206 pChild = &pChild->getChild(0);
207 CPPUNIT_ASSERT(pChild != NULL);
208 CPPUNIT_ASSERT(pChild->isText());
209 CPPUNIT_ASSERT(pChild->getCharacters().find(
"set ") != std::string::npos);
212 SBMLDocument *pDocument =
new SBMLDocument(2, 4);
213 CPPUNIT_ASSERT(pDocument != NULL);
214 Model* pModel = pDocument->createModel(
"test_model");
215 CPPUNIT_ASSERT(pModel != NULL);
216 int set_result = pModel->setNotes(pNotes);
217 CPPUNIT_ASSERT(set_result == LIBSBML_OPERATION_SUCCESS);
225 CPPUNIT_ASSERT(pNotes != NULL);
226 CPPUNIT_ASSERT(pNotes->getName() ==
"body");
227 CPPUNIT_ASSERT(pNotes->getURI() ==
"http://www.w3.org/1999/xhtml");
228 CPPUNIT_ASSERT(pNotes->hasNamespaceURI(
"http://www.w3.org/1999/xhtml") ==
true);
230 CPPUNIT_ASSERT(pNotes->getNumChildren() == 4);
231 XMLNode* pChild = &pNotes->getChild(0);
232 CPPUNIT_ASSERT(pChild != NULL);
233 CPPUNIT_ASSERT(pChild->isText());
234 CPPUNIT_ASSERT(pChild->getCharacters().find(
"This") != std::string::npos);
235 pChild = &pNotes->getChild(1);
236 CPPUNIT_ASSERT(pChild != NULL);
237 CPPUNIT_ASSERT(pChild->isElement());
238 CPPUNIT_ASSERT(pChild->getName() ==
"p");
239 CPPUNIT_ASSERT(pChild->getNumChildren() == 1);
240 pChild = &pChild->getChild(0);
241 CPPUNIT_ASSERT(pChild != NULL);
242 CPPUNIT_ASSERT(pChild->isText());
243 CPPUNIT_ASSERT(pChild->getCharacters().find(
"mixed") != std::string::npos);
244 pChild = &pNotes->getChild(2);
245 CPPUNIT_ASSERT(pChild != NULL);
246 CPPUNIT_ASSERT(pChild->isText());
247 CPPUNIT_ASSERT(pChild->getCharacters().find(
"paragraphs") != std::string::npos);
248 pChild = &pNotes->getChild(3);
249 CPPUNIT_ASSERT(pChild != NULL);
250 CPPUNIT_ASSERT(pChild->isElement());
251 CPPUNIT_ASSERT(pChild->getName() ==
"p");
252 CPPUNIT_ASSERT(pChild->getNumChildren() == 1);
253 pChild = &pChild->getChild(0);
254 CPPUNIT_ASSERT(pChild != NULL);
255 CPPUNIT_ASSERT(pChild->isText());
256 CPPUNIT_ASSERT(pChild->getCharacters().find(
"set ") != std::string::npos);
259 SBMLDocument *pDocument =
new SBMLDocument(2, 4);
260 CPPUNIT_ASSERT(pDocument != NULL);
261 Model* pModel = pDocument->createModel(
"test_model");
262 CPPUNIT_ASSERT(pModel != NULL);
263 int set_result = pModel->setNotes(pNotes);
264 CPPUNIT_ASSERT(set_result == LIBSBML_OPERATION_SUCCESS);
271 "to see if simple text is\n"
276 "<p>This is a test\n"
277 "to see if a single paragraph is\n"
278 "set correctly.</p>\n"
282 "<p>This is a test</p>\n"
283 "<p>to see if a several paragraphs are</p>\n"
284 "<p>set correctly.</p>\n"
289 "<p>to see if text mixed with</p>\n"
290 "several paragraphs is\n"
291 "<p>set correctly.</p>\n"
297 "<p>to see if body element plus text mixed with</p>\n"
298 "several paragraphs is\n"
299 "<p>set correctly.</p>\n"
304 "<body xmlns=\"http://www.w3.org/1999/xhtml\"> \n"
306 "<p>to see if body element plus text mixed with</p>\n"
307 "several paragraphs is\n"
308 "<p>set correctly.</p>\n"
void test_export_model_notes_5()
static const char * NOTES_STRING_3
void test_export_model_notes_3()
static const char * NOTES_STRING_4
static const char * NOTES_STRING_5
void test_export_model_notes_4()
void test_export_model_notes_2()
static const char * NOTES_STRING_1
void test_export_model_notes_1()
static const char * NOTES_STRING_6
static void init(int argc, char *argv[], const bool &withGui=false)
void test_export_model_notes_6()
static const char * NOTES_STRING_2