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

#include <test000050.h>

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

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_bug894 ()
 

Static Protected Attributes

static const char * MODEL_STRING
 
static CCopasiDataModelpCOPASIDATAMODEL = NULL
 

Private Member Functions

 CPPUNIT_TEST (test_bug894)
 
 CPPUNIT_TEST_SUITE (test000050)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 24 of file test000050.h.

Member Function Documentation

test000050::CPPUNIT_TEST ( test_bug894  )
private
test000050::CPPUNIT_TEST_SUITE ( test000050  )
private
test000050::CPPUNIT_TEST_SUITE_END ( )
private
void test000050::setUp ( )

Definition at line 30 of file test000050.cpp.

References CCopasiRootContainer::addDatamodel(), CCopasiRootContainer::init(), and pCOPASIDATAMODEL.

31 {
32  // Create the root container.
33  CCopasiRootContainer::init(0, NULL, false);
34  // Create the global data model.
36 }
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000050.h:32
static CCopasiDataModel * addDatamodel()
static void init(int argc, char *argv[], const bool &withGui=false)
void test000050::tearDown ( )

Definition at line 38 of file test000050.cpp.

References CCopasiRootContainer::destroy().

void test000050::test_bug894 ( )

Definition at line 43 of file test000050.cpp.

References CCopasiDataModel::exportSBMLToString(), CCopasiDataModel::getCurrentSBMLDocument(), CCopasiDataModel::getModel(), load_cps_model_from_stream(), MODEL_STRING, and pCOPASIDATAMODEL.

44 {
45  // load the CPS file
46  // export to SBML
47  // check the resulting SBML model
48  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
49  std::istringstream iss(test000050::MODEL_STRING);
50  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
51  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
52 
53  std::string sbml = pDataModel->exportSBMLToString(NULL, 2, 3);
54  CPPUNIT_ASSERT(sbml.empty() == false);
55  SBMLDocument* doc = pDataModel->getCurrentSBMLDocument();
56  CPPUNIT_ASSERT(doc != NULL);
57  CPPUNIT_ASSERT(doc->getModel() != NULL);
58  CPPUNIT_ASSERT(doc->getModel()->getNumFunctionDefinitions() > 0);
59 
60  SBase* def = doc->getModel()->getFunctionDefinition(0);
61  CPPUNIT_ASSERT(def != NULL);
62 
63  FunctionDefinition* fDef = dynamic_cast<FunctionDefinition*>(def);
64  CPPUNIT_ASSERT(def != NULL);
65  CPPUNIT_ASSERT(def->isSetAnnotation() == true);
66  CPPUNIT_ASSERT(def->getAnnotation() != NULL);
67  CPPUNIT_ASSERT(def->getAnnotation()->getNumChildren() == 1);
68  CPPUNIT_ASSERT(def->getAnnotation()->getChild(0).getURI() == "http://sbml.org/annotations/distribution");
69  CPPUNIT_ASSERT(def->getAnnotation()->getChild(0).getAttrValue("definition") == "http://www.uncertml.org/distributions/uniform");
70 }
SBMLDocument * getCurrentSBMLDocument()
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000050.h:32
std::string exportSBMLToString(CProcessReport *pExportHandler, int sbmlLevel, int sbmlVersion)
bool load_cps_model_from_stream(std::istream &is, CCopasiDataModel &dataModel)
Definition: utilities.cpp:21
static const char * MODEL_STRING
Definition: test000050.h:31

Member Data Documentation

const char * test000050::MODEL_STRING
staticprotected
Initial value:
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<!-- generated with COPASI 4.3.25 (Debug) (http://www.copasi.org) at 2008-02-27 12:47:16 UTC -->\n"
"<COPASI xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.copasi.org/static/schema.xsd\" versionMajor=\"1\" versionMinor=\"0\" versionDevel=\"25\">\n"
" <Model key=\"Model_0\" name=\"New Model\" timeUnit=\"s\" volumeUnit=\"ml\" quantityUnit=\"mmol\" type=\"deterministic\">\n"
" <Comment>\n"
" <body xmlns=\"http://www.w3.org/1999/xhtml\">\n"
" \n"
" </body>\n"
" </Comment>\n"
" <ListOfModelValues>\n"
" <ModelValue key=\"ModelValue_0\" name=\"K\" simulationType=\"fixed\">\n"
" <InitialExpression>\n"
" uniform(4.0,0.5)\n"
" </InitialExpression>\n"
" </ModelValue>\n"
" </ListOfModelValues>\n"
" <StateTemplate>\n"
" <StateTemplateVariable objectReference=\"Model_0\"/>\n"
" <StateTemplateVariable objectReference=\"ModelValue_0\"/>\n"
" </StateTemplate>\n"
" <InitialState type=\"initialState\">\n"
" 0 4.12243135037551\n"
" </InitialState>\n"
" </Model>\n"
"</COPASI>\n"

Definition at line 31 of file test000050.h.

Referenced by test_bug894().

CCopasiDataModel * test000050::pCOPASIDATAMODEL = NULL
staticprotected

Definition at line 32 of file test000050.h.

Referenced by setUp(), and test_bug894().


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