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

#include <test000103.h>

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

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_bug1743_l2 ()
 
void test_bug1743_l3 ()
 

Protected Attributes

CCopasiDataModelpDataModel
 

Static Protected Attributes

static const char * SBML_STRING
 

Private Member Functions

 CPPUNIT_TEST (test_bug1743_l2)
 
 CPPUNIT_TEST (test_bug1743_l3)
 
 CPPUNIT_TEST_SUITE (test000103)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 28 of file test000103.h.

Member Function Documentation

test000103::CPPUNIT_TEST ( test_bug1743_l2  )
private
test000103::CPPUNIT_TEST ( test_bug1743_l3  )
private
test000103::CPPUNIT_TEST_SUITE ( test000103  )
private
test000103::CPPUNIT_TEST_SUITE_END ( )
private
void test000103::setUp ( )

Definition at line 17 of file test000103.cpp.

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

18 {
19  // Create the root container.
20  CCopasiRootContainer::init(0, NULL, false);
22 }
static CCopasiDataModel * addDatamodel()
CCopasiDataModel * pDataModel
Definition: test000103.h:39
static void init(int argc, char *argv[], const bool &withGui=false)
void test000103::tearDown ( )

Definition at line 24 of file test000103.cpp.

References CCopasiRootContainer::destroy().

void test000103::test_bug1743_l2 ( )

Definition at line 29 of file test000103.cpp.

References CCopasiDataModel::exportSBMLToString(), CCopasiDataModel::getModel(), CModelEntity::getSBMLId(), CCopasiDataModel::importSBMLFromString(), CCopasiDataModel::newModel(), pDataModel, and CModelEntity::setSBMLId().

30 {
31  CModel* pModel = pDataModel->getModel();
32  CPPUNIT_ASSERT(pModel != NULL);
33  std::string id("MyTestModel");
34  pModel->setSBMLId(id);
35  CPPUNIT_ASSERT(pModel->getSBMLId() == id);
36  // export to l2v4
37  std::string model_string = pDataModel->exportSBMLToString(NULL, 2, 4);
38  pModel = pDataModel->getModel();
39  CPPUNIT_ASSERT(pModel != NULL);
40  CPPUNIT_ASSERT(pModel->getSBMLId() == id);
41  pDataModel->newModel(NULL, true);
42  pModel = pDataModel->getModel();
43  CPPUNIT_ASSERT(pModel != NULL);
44  CPPUNIT_ASSERT(pModel->getSBMLId() != id);
45 
46  try
47  {
48  bool result = pDataModel->importSBMLFromString(model_string);
49  CPPUNIT_ASSERT(result == true);
50  }
51  catch (...)
52  {
53  CPPUNIT_ASSERT_MESSAGE("Exception while importing the exported model string.", false);
54  }
55 
56  pModel = pDataModel->getModel();
57  CPPUNIT_ASSERT(pModel != NULL);
58  CPPUNIT_ASSERT(pModel->getSBMLId() == id);
59 }
const std::string & getSBMLId() const
std::string exportSBMLToString(CProcessReport *pExportHandler, int sbmlLevel, int sbmlVersion)
bool newModel(CProcessReport *pProcessReport, const bool &deleteOldData)
CCopasiDataModel * pDataModel
Definition: test000103.h:39
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
void setSBMLId(const std::string &id)
void test000103::test_bug1743_l3 ( )

Definition at line 61 of file test000103.cpp.

References CCopasiDataModel::exportSBMLToString(), CCopasiDataModel::getModel(), CModelEntity::getSBMLId(), CCopasiDataModel::importSBMLFromString(), CCopasiDataModel::newModel(), pDataModel, and CModelEntity::setSBMLId().

62 {
63  CModel* pModel = pDataModel->getModel();
64  CPPUNIT_ASSERT(pModel != NULL);
65  std::string id("MyTestModel");
66  pModel->setSBMLId(id);
67  CPPUNIT_ASSERT(pModel->getSBMLId() == id);
68  // export to l3v1
69  std::string model_string = pDataModel->exportSBMLToString(NULL, 3, 1);
70  pModel = pDataModel->getModel();
71  CPPUNIT_ASSERT(pModel != NULL);
72  CPPUNIT_ASSERT(pModel->getSBMLId() == id);
73  pDataModel->newModel(NULL, true);
74  pModel = pDataModel->getModel();
75  CPPUNIT_ASSERT(pModel != NULL);
76  CPPUNIT_ASSERT(pModel->getSBMLId() != id);
77 
78  try
79  {
80  bool result = pDataModel->importSBMLFromString(model_string);
81  CPPUNIT_ASSERT(result == true);
82  }
83  catch (...)
84  {
85  CPPUNIT_ASSERT_MESSAGE("Exception while importing the exported model string.", false);
86  }
87 
88  pModel = pDataModel->getModel();
89  CPPUNIT_ASSERT(pModel != NULL);
90  CPPUNIT_ASSERT(pModel->getSBMLId() == id);
91 }
const std::string & getSBMLId() const
std::string exportSBMLToString(CProcessReport *pExportHandler, int sbmlLevel, int sbmlVersion)
bool newModel(CProcessReport *pProcessReport, const bool &deleteOldData)
CCopasiDataModel * pDataModel
Definition: test000103.h:39
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
Definition: CModel.h:50
void setSBMLId(const std::string &id)

Member Data Documentation

CCopasiDataModel* test000103::pDataModel
protected

Definition at line 39 of file test000103.h.

Referenced by setUp(), test_bug1743_l2(), and test_bug1743_l3().

const char* test000103::SBML_STRING
staticprotected

Definition at line 37 of file test000103.h.


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