// tests whether we are importing global render information void test000098::test_export_notes() { CPPUNIT_ASSERT(pDataModel != NULL); std::istringstream iss(test000098::CPS_MODEL_1); CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true); std::string s; try { s = pDataModel->exportSBMLToString(NULL, 2, 1); } catch (...) { CPPUNIT_ASSERT(false); } CPPUNIT_ASSERT(!s.empty()); SBMLReader reader; SBMLDocument* pSBMLDocument = NULL; try { pSBMLDocument = reader.readSBMLFromString(s); } catch (...) { CPPUNIT_ASSERT(false); } CPPUNIT_ASSERT(pSBMLDocument != NULL); Model* pModel = pSBMLDocument->getModel(); CPPUNIT_ASSERT(pModel != NULL); CPPUNIT_ASSERT(pModel->isSetNotes() == true); std::string notes = pModel->getNotesString(); CPPUNIT_ASSERT(!notes.empty()); CPPUNIT_ASSERT(notes.find("Simple note on model") != std::string::npos); CPPUNIT_ASSERT(pModel->getNumCompartments() == 1); CPPUNIT_ASSERT(pModel->getNumSpecies() == 1); CPPUNIT_ASSERT(pModel->getNumParameters() == 1); CPPUNIT_ASSERT(pModel->getNumReactions() == 1); CPPUNIT_ASSERT(pModel->getNumEvents() == 1); // compartment SBase* pObject = pModel->getCompartment(0); CPPUNIT_ASSERT(pObject != NULL); CPPUNIT_ASSERT(pObject->isSetNotes() == true); notes = pObject->getNotesString(); CPPUNIT_ASSERT(!notes.empty()); CPPUNIT_ASSERT(notes.find("Simple note on compartment") != std::string::npos); // species pObject = pModel->getSpecies(0); CPPUNIT_ASSERT(pObject != NULL); CPPUNIT_ASSERT(pObject->isSetNotes() == true); notes = pObject->getNotesString(); CPPUNIT_ASSERT(!notes.empty()); CPPUNIT_ASSERT(notes.find("Simple note on species") != std::string::npos); // parameter pObject = pModel->getParameter(0); CPPUNIT_ASSERT(pObject != NULL); CPPUNIT_ASSERT(pObject->isSetNotes() == true); notes = pObject->getNotesString(); CPPUNIT_ASSERT(!notes.empty()); CPPUNIT_ASSERT(notes.find("Simple note on parameter") != std::string::npos); // reaction pObject = pModel->getReaction(0); CPPUNIT_ASSERT(pObject != NULL); CPPUNIT_ASSERT(pObject->isSetNotes() == true); notes = pObject->getNotesString(); CPPUNIT_ASSERT(!notes.empty()); CPPUNIT_ASSERT(notes.find("Simple note on reaction") != std::string::npos); // event pObject = pModel->getEvent(0); CPPUNIT_ASSERT(pObject != NULL); CPPUNIT_ASSERT(pObject->isSetNotes() == true); notes = pObject->getNotesString(); CPPUNIT_ASSERT(!notes.empty()); CPPUNIT_ASSERT(notes.find("Simple note on event") != std::string::npos); }