COPASI API  4.16.103
test000074.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/sbml/unittests/test000074.cpp,v $
3 // $Revision: 1.5 $
4 // $Name: $
5 // $Author: gauges $
6 // $Date: 2010/03/11 11:52:00 $
7 // End CVS Header
8 
9 // Copyright (C) 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
16 // and The University of Manchester.
17 // All rights reserved.
18 
19 #include "test000074.h"
20 
21 #include <sstream>
22 #include <string>
24 
26 
27 /**
28  * Make sure importing a model with COPASI MIRIAM annotation and exporting it
29  * again does not CRASH
30  */
31 CCopasiDataModel* test000074::pCOPASIDATAMODEL = NULL;
32 
34 {
35  // Create the root container.
36  CCopasiRootContainer::init(0, NULL, false);
37  // Create the global data model.
39 }
40 
42 {
44 }
45 
47 {
48  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
49  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING1));
50  std::string s = pDataModel->exportSBMLToString(NULL, 2, 3);
51  CPPUNIT_ASSERT(!s.empty());
52 }
53 
54 const char* test000074::MODEL_STRING1 =
55  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
56  "<sbml xmlns=\"http://www.sbml.org/sbml/level2/version3\" metaid=\"metaid_0000001\" level=\"2\" version=\"3\">\n"
57  " <model metaid=\"metaid_0000002\" id=\"model_1\" name=\"model_1\">\n"
58  " <annotation>\n"
59  " <COPASI xmlns=\"http://www.copasi.org/static/sbml\">\n"
60  " <rdf:RDF xmlns:CopasiMT=\"http://www.copasi.org/RDF/MiriamTerms#\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:vCard=\"http://www.w3.org/2001/vcard-rdf/3.0#\">\n"
61  " <rdf:Description rdf:about=\"#metaid_0000002\">\n"
62  " <dcterms:bibliographicCitation>\n"
63  " <rdf:Description>\n"
64  " <CopasiMT:isDescribedBy rdf:resource=\"urn:miriam:pubmed:14556891\"/>\n"
65  " </rdf:Description>\n"
66  " </dcterms:bibliographicCitation>\n"
67  " <dcterms:created>\n"
68  " <rdf:Description>\n"
69  " <dcterms:W3CDTF>2007-03-22T10:28:32Z</dcterms:W3CDTF>\n"
70  " </rdf:Description>\n"
71  " </dcterms:created>\n"
72  " <dcterms:creator>\n"
73  " <rdf:Description>\n"
74  " <rdf:Bag/>\n"
75  " </rdf:Description>\n"
76  " </dcterms:creator>\n"
77  " <dcterms:modified>\n"
78  " <rdf:Description>\n"
79  " <dcterms:W3CDTF>2007-09-25T11:11:02Z</dcterms:W3CDTF>\n"
80  " </rdf:Description>\n"
81  " </dcterms:modified>\n"
82  " <CopasiMT:hasPart>\n"
83  " <rdf:Bag>\n"
84  " <rdf:li rdf:resource=\"urn:miriam:kegg.pathway:hsa04020\"/>\n"
85  " <rdf:li rdf:resource=\"urn:miriam:obo.go:GO%3A0008607\"/>\n"
86  " </rdf:Bag>\n"
87  " </CopasiMT:hasPart>\n"
88  " <CopasiMT:is rdf:resource=\"urn:miriam:biomodels.db:BIOMD0000000100\"/>\n"
89  " <CopasiMT:isVersionOf>\n"
90  " <rdf:Bag>\n"
91  " <rdf:li rdf:resource=\"urn:miriam:obo.go:GO%3A0019722\"/>\n"
92  " <rdf:li rdf:resource=\"urn:miriam:obo.go:GO%3A0048016\"/>\n"
93  " </rdf:Bag>\n"
94  " </CopasiMT:isVersionOf>\n"
95  " </rdf:Description>\n"
96  " </rdf:RDF>\n"
97  " </COPASI>\n"
98  " </annotation>\n"
99  " </model>\n"
100  "</sbml>\n";
void setUp()
Definition: test000074.cpp:33
std::string exportSBMLToString(CProcessReport *pExportHandler, int sbmlLevel, int sbmlVersion)
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000074.h:34
void test_bug1088()
Definition: test000074.cpp:46
void tearDown()
Definition: test000074.cpp:41
static CCopasiDataModel * addDatamodel()
static const char * MODEL_STRING1
Definition: test000074.h:33
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
static void init(int argc, char *argv[], const bool &withGui=false)