COPASI API  4.16.103
Public Member Functions | Static Protected Attributes | Private Member Functions | List of all members
test000096 Class Reference

#include <test000096.h>

Inheritance diagram for test000096:
Inheritance graph
[legend]
Collaboration diagram for test000096:
Collaboration graph
[legend]

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_export_model_notes_1 ()
 
void test_export_model_notes_2 ()
 
void test_export_model_notes_3 ()
 
void test_export_model_notes_4 ()
 
void test_export_model_notes_5 ()
 
void test_export_model_notes_6 ()
 

Static Protected Attributes

static const char * NOTES_STRING_1
 
static const char * NOTES_STRING_2
 
static const char * NOTES_STRING_3
 
static const char * NOTES_STRING_4
 
static const char * NOTES_STRING_5
 
static const char * NOTES_STRING_6
 

Private Member Functions

 CPPUNIT_TEST (test_export_model_notes_1)
 
 CPPUNIT_TEST (test_export_model_notes_2)
 
 CPPUNIT_TEST (test_export_model_notes_3)
 
 CPPUNIT_TEST (test_export_model_notes_4)
 
 CPPUNIT_TEST (test_export_model_notes_5)
 
 CPPUNIT_TEST (test_export_model_notes_6)
 
 CPPUNIT_TEST_SUITE (test000096)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Tests for setting notes on SBML models

Definition at line 27 of file test000096.h.

Member Function Documentation

test000096::CPPUNIT_TEST ( test_export_model_notes_1  )
private
test000096::CPPUNIT_TEST ( test_export_model_notes_2  )
private
test000096::CPPUNIT_TEST ( test_export_model_notes_3  )
private
test000096::CPPUNIT_TEST ( test_export_model_notes_4  )
private
test000096::CPPUNIT_TEST ( test_export_model_notes_5  )
private
test000096::CPPUNIT_TEST ( test_export_model_notes_6  )
private
test000096::CPPUNIT_TEST_SUITE ( test000096  )
private
test000096::CPPUNIT_TEST_SUITE_END ( )
private
void test000096::setUp ( )

Definition at line 25 of file test000096.cpp.

References CCopasiRootContainer::init().

26 {
27  // Create the root container.
28  CCopasiRootContainer::init(0, NULL, false);
29 }
static void init(int argc, char *argv[], const bool &withGui=false)
void test000096::tearDown ( )

Definition at line 31 of file test000096.cpp.

References CCopasiRootContainer::destroy().

void test000096::test_export_model_notes_1 ( )

Definition at line 36 of file test000096.cpp.

References NOTES_STRING_1.

37 {
38  XMLNode* pNotes = CSBMLExporter::createSBMLNotes(NOTES_STRING_1);
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);
57  delete pDocument;
58  delete pNotes;
59 }
static const char * NOTES_STRING_1
Definition: test000096.h:39
void test000096::test_export_model_notes_2 ( )

Definition at line 61 of file test000096.cpp.

References NOTES_STRING_2.

62 {
63  XMLNode* pNotes = CSBMLExporter::createSBMLNotes(NOTES_STRING_2);
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);
79  delete pDocument;
80  delete pNotes;
81 }
static const char * NOTES_STRING_2
Definition: test000096.h:40
void test000096::test_export_model_notes_3 ( )

Definition at line 83 of file test000096.cpp.

References NOTES_STRING_3.

84 {
85  XMLNode* pNotes = CSBMLExporter::createSBMLNotes(NOTES_STRING_3);
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);
118 
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);
125  delete pDocument;
126  delete pNotes;
127 }
static const char * NOTES_STRING_3
Definition: test000096.h:41
void test000096::test_export_model_notes_4 ( )

Definition at line 129 of file test000096.cpp.

References NOTES_STRING_4.

130 {
131  XMLNode* pNotes = CSBMLExporter::createSBMLNotes(NOTES_STRING_4);
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);
136 
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);
164 
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);
171  delete pDocument;
172  delete pNotes;
173 }
static const char * NOTES_STRING_4
Definition: test000096.h:42
void test000096::test_export_model_notes_5 ( )

Definition at line 175 of file test000096.cpp.

References NOTES_STRING_5.

176 {
177  XMLNode* pNotes = CSBMLExporter::createSBMLNotes(NOTES_STRING_5);
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);
182 
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);
210 
211 
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);
218  delete pDocument;
219  delete pNotes;
220 }
static const char * NOTES_STRING_5
Definition: test000096.h:43
void test000096::test_export_model_notes_6 ( )

Definition at line 222 of file test000096.cpp.

References NOTES_STRING_6.

223 {
224  XMLNode* pNotes = CSBMLExporter::createSBMLNotes(NOTES_STRING_6);
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);
229 
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);
257 
258 
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);
265  delete pDocument;
266  delete pNotes;
267 }
static const char * NOTES_STRING_6
Definition: test000096.h:44

Member Data Documentation

const char * test000096::NOTES_STRING_1
staticprotected
Initial value:
=
"This is a test\n"
"to see if simple text is\n"
"set correctly.\n"

Definition at line 39 of file test000096.h.

Referenced by test_export_model_notes_1().

const char * test000096::NOTES_STRING_2
staticprotected
Initial value:
=
"<p>This is a test\n"
"to see if a single paragraph is\n"
"set correctly.</p>\n"

Definition at line 40 of file test000096.h.

Referenced by test_export_model_notes_2().

const char * test000096::NOTES_STRING_3
staticprotected
Initial value:
=
"<p>This is a test</p>\n"
"<p>to see if a several paragraphs are</p>\n"
"<p>set correctly.</p>\n"

Definition at line 41 of file test000096.h.

Referenced by test_export_model_notes_3().

const char * test000096::NOTES_STRING_4
staticprotected
Initial value:
=
"This is a test\n"
"<p>to see if text mixed with</p>\n"
"several paragraphs is\n"
"<p>set correctly.</p>\n"

Definition at line 42 of file test000096.h.

Referenced by test_export_model_notes_4().

const char * test000096::NOTES_STRING_5
staticprotected
Initial value:
=
"<body>\n"
"This is a test\n"
"<p>to see if body element plus text mixed with</p>\n"
"several paragraphs is\n"
"<p>set correctly.</p>\n"
"</body>\n"

Definition at line 43 of file test000096.h.

Referenced by test_export_model_notes_5().

const char * test000096::NOTES_STRING_6
staticprotected
Initial value:
=
"<body xmlns=\"http://www.w3.org/1999/xhtml\"> \n"
"This is a test\n"
"<p>to see if body element plus text mixed with</p>\n"
"several paragraphs is\n"
"<p>set correctly.</p>\n"
"</body>\n"

Definition at line 44 of file test000096.h.

Referenced by test_export_model_notes_6().


The documentation for this class was generated from the following files: