getModel() public method

public getModel ( ) : Model
return Model
 public void setUp()
 {
     string filename = "../../annotation/test/test-data/annotationL3.xml";
       d = libsbml.readSBML(filename);
       m = d.getModel();
       c = m.getCompartment(0);
 }
 public void test_SBMLConvertStrict_convertNonStrictSBO()
 {
     SBMLDocument d = new  SBMLDocument(2,4);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId( "c");
       c.setConstant(false);
       (c).setSBOTerm(64);
       assertTrue( d.setLevelAndVersion(2,3,true) == false );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       assertTrue( d.setLevelAndVersion(2,2,true) == false );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       assertTrue( d.setLevelAndVersion(2,1,true) == true );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 1 );
       Compartment c1 = d.getModel().getCompartment(0);
       assertTrue( (c1).getSBOTerm() == -1 );
       assertTrue( d.setLevelAndVersion(1,2,true) == true );
       assertTrue( d.getLevel() == 1 );
       assertTrue( d.getVersion() == 2 );
       Compartment c2 = d.getModel().getCompartment(0);
       assertTrue( (c2).getSBOTerm() == -1 );
       d = null;
 }
 public void test_SBMLConvertStrict_convertL1ParamRule()
 {
     SBMLDocument d = new  SBMLDocument(1,2);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId( "c");
       Parameter p = m.createParameter();
       p.setId( "p");
       Parameter p1 = m.createParameter();
       p1.setId( "p1");
       ASTNode math = libsbml.parseFormula("p");
       Rule ar = m.createAssignmentRule();
       ar.setVariable( "p1");
       ar.setMath(math);
       ar.setUnits( "mole");
       assertTrue( d.setLevelAndVersion(2,1,true) == true );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 1 );
       Rule r1 = d.getModel().getRule(0);
       assertTrue( r1.getUnits() == "" );
       d = null;
 }
Beispiel #4
0
 public void test_ReadSBML_notes()
 {
     Reaction r;
       KineticLaw kl;
       string s = wrapSBML_L2v3("<listOfReactions>" +
     "<reaction name='J1'>" +
     "  <kineticLaw formula='k1*X0'>" +
     "    <notes>This is a test note.</notes>" +
     "    <listOfParameters>" +
     "      <parameter name='k1' value='0'/>" +
     "    </listOfParameters>" +
     "  </kineticLaw>" +
     "</reaction>" +
     "</listOfReactions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       r = M.getReaction(0);
       kl = r.getKineticLaw();
       assertTrue( kl.getNotes() != null );
       string notes = kl.getNotes().getChild(0).getCharacters();
       assertTrue( (  "This is a test note." != notes ) == false );
 }
Beispiel #5
0
 public void test_Model_ancestor_create()
 {
     SBMLDocument d = new SBMLDocument();
       Model m = d.createModel();
       assertTrue( m.getAncestorOfType(libsbml.SBML_DOCUMENT) == d );
       Model obj = d.getModel();
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == d );
       d = null;
 }
Beispiel #6
0
        public void test_ReadSBML_line_col_numbers()
        {
            //setXMLParser();

              SBase sb;
              string s = "<?xml version='1.0' encoding='UTF-8'?>\n" +
            "<sbml xmlns='http://www.sbml.org/sbml/level2' level='2' version='1'>\n" +
            "  <model id='testModel' name='testModel'>\n" +
            "    <listOfReactions> <reaction/> </listOfReactions>\n" +
            "  </model>\n" +
            "</sbml>\n";
              D = libsbml.readSBMLFromString(s);
              M = D.getModel();
              assertTrue( M != null );
              sb = M;
              sb = M.getListOfReactions();
              sb = M.getReaction(0);
        }
Beispiel #7
0
 public void test_SBMLConvert_convertToL3_stoichiometryMath()
 {
     SBMLDocument d = new  SBMLDocument(2,1);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId( "c" );
       Species s = m.createSpecies();
       s.setId( "s");
       s.setCompartment( "c");
       Reaction r = m.createReaction();
       SpeciesReference sr = r.createReactant();
       sr.setSpecies( "s");
       StoichiometryMath sm = sr.createStoichiometryMath();
       ASTNode ast = libsbml.parseFormula("c*2");
       sm.setMath(ast);
       assertTrue( m.getNumRules() == 0 );
       assertTrue( sr.isSetId() == false );
       assertTrue( d.setLevelAndVersion(3,1,false) == true );
       m = d.getModel();
       r = m.getReaction(0);
       sr = r.getReactant(0);
       assertTrue( m.getNumRules() == 1 );
       assertTrue( sr.isSetId() == true );
       Rule rule = m.getRule(0);
       assertTrue( sr.getId() == rule.getVariable() );
       d = null;
 }
Beispiel #8
0
 public void test_SBMLConvert_convertToL2v4_DuplicateAnnotations_model()
 {
     SBMLDocument d = new  SBMLDocument(2,1);
       Model m = d.createModel();
       string annotation =  "<rdf/>\n<rdf/>";
       int i = (m).setAnnotation(annotation);
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 1 );
       assertTrue( (m).getAnnotation().getNumChildren() == 2 );
       assertTrue( d.setLevelAndVersion(2,4,true) == true );
       assertTrue( d.getLevel() == 2 );
       assertTrue( d.getVersion() == 4 );
       m = d.getModel();
       assertTrue( (m).getAnnotation().getNumChildren() == 1 );
       d = null;
 }
 public void test_SBMLDocument_setModel3()
 {
     SBMLDocument d = new  SBMLDocument(2,2);
       Model m1 = new  Model(2,2);
       int i = d.setModel(m1);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( d.getModel() != null );
       d = null;
 }
Beispiel #10
0
 public void test_SBMLDocument_setModel()
 {
     SBMLDocument d = new  SBMLDocument(2,4);
       Model m1 = new  Model(2,4);
       Model m2 = new  Model(2,4);
       Model mout;
       assertTrue( d.getModel() == null );
       int i = d.setModel(m1);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       mout = d.getModel();
       assertTrue( mout != null );
       assertTrue( mout != m1 );
       i = d.setModel(d.getModel());
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       mout = d.getModel();
       assertTrue( mout != null );
       assertTrue( mout != m1 );
       i = d.setModel(m2);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       mout = d.getModel();
       assertTrue( mout != null );
       assertTrue( mout != m2 );
       d = null;
 }
 public void test_Model_parent_add()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       Model m = new Model(2,4);
       d.setModel(m);
       assertTrue( d == d.getModel().getParentSBMLObject() );
       d = null;
 }
Beispiel #12
0
 public void test_ReadSBML_Model()
 {
     string s = wrapXML("<sbml level='1' version='1'>" +
     "  <model name='testModel'></model>" +
     "</sbml>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue((  "testModel" == M.getId() ));
 }
Beispiel #13
0
 public void test_ReadSBML_Model_L2()
 {
     string s = wrapXML("<sbml level='2' version='1'>" +
     "  <model id='testModel'> </model>" +
     "</sbml>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertEquals( true, M.isSetId() );
       assertEquals( false, M.isSetName() );
       assertTrue((  "testModel" == M.getId() ));
 }
Beispiel #14
0
 public void test_ReadSBML_metaid_Unit()
 {
     SBase sb;
       UnitDefinition ud;
       string s = wrapSBML_L2v1("<listOfUnitDefinitions>" +
     "  <unitDefinition metaid='ud'>" +
     "    <listOfUnits metaid='lou'>" +
     "      <unit metaid='u'/>" +
     "    </listOfUnits>" +
     "  </unitDefinition>" +
     "</listOfUnitDefinitions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M != null );
       ud = M.getUnitDefinition(0);
       sb = ud;
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "ud" == sb.getMetaId() ));
       sb = ud.getListOfUnits();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "lou" == sb.getMetaId() ));
       sb = ud.getUnit(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "u" == sb.getMetaId() ));
 }
Beispiel #15
0
 public void test_ReadSBML_metaid_Reaction()
 {
     SBase sb;
       Reaction r;
       string s = wrapSBML_L2v1("<listOfReactions>" +
     "  <reaction metaid='r'>" +
     "    <listOfReactants metaid='lor'>" +
     "      <speciesReference metaid='sr1'/>" +
     "    </listOfReactants>" +
     "    <listOfProducts metaid='lop'>" +
     "      <speciesReference metaid='sr2'/>" +
     "    </listOfProducts>" +
     "    <listOfModifiers metaid='lom'>" +
     "      <modifierSpeciesReference metaid='msr'/>" +
     "    </listOfModifiers>" +
     "    <kineticLaw metaid='kl'/>" +
     "  </reaction>" +
     "</listOfReactions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M != null );
       r = M.getReaction(0);
       sb = r;
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "r" == sb.getMetaId() ));
       sb = r.getListOfReactants();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "lor" == sb.getMetaId() ));
       sb = r.getReactant(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "sr1" == sb.getMetaId() ));
       sb = r.getListOfProducts();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "lop" == sb.getMetaId() ));
       sb = r.getProduct(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "sr2" == sb.getMetaId() ));
       sb = r.getListOfModifiers();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "lom" == sb.getMetaId() ));
       sb = r.getModifier(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "msr" == sb.getMetaId() ));
       sb = r.getKineticLaw();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "kl" == sb.getMetaId() ));
 }
Beispiel #16
0
 public void test_ReadSBML_metaid_ListOf()
 {
     SBase sb;
       string s = wrapSBML_L2v1("<listOfFunctionDefinitions metaid='lofd'/>" +
     "<listOfUnitDefinitions     metaid='loud'/>" +
     "<listOfCompartments        metaid='loc'/>" +
     "<listOfSpecies             metaid='los'/>" +
     "<listOfParameters          metaid='lop'/>" +
     "<listOfRules               metaid='lor'/>" +
     "<listOfReactions           metaid='lorx'/>" +
     "<listOfEvents              metaid='loe'/>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M != null );
       sb = M.getListOfFunctionDefinitions();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "lofd" == sb.getMetaId() ));
       sb = M.getListOfUnitDefinitions();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "loud" == sb.getMetaId() ));
       sb = M.getListOfCompartments();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "loc" == sb.getMetaId() ));
       sb = M.getListOfSpecies();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "los" == sb.getMetaId() ));
       sb = M.getListOfParameters();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "lop" == sb.getMetaId() ));
       sb = M.getListOfRules();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "lor" == sb.getMetaId() ));
       sb = M.getListOfReactions();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "lorx" == sb.getMetaId() ));
       sb = M.getListOfEvents();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "loe" == sb.getMetaId() ));
 }
Beispiel #17
0
 public void test_ReadSBML_metaid_Event()
 {
     SBase sb;
       Event e;
       string s = wrapSBML_L2v1("<listOfEvents>" +
     "  <event metaid='e'>" +
     "    <listOfEventAssignments metaid='loea'>" +
     "      <eventAssignment metaid='ea'/>" +
     "    </listOfEventAssignments>" +
     "  </event>" +
     "</listOfEvents>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M != null );
       e = M.getEvent(0);
       sb = e;
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "e" == sb.getMetaId() ));
       sb = e.getListOfEventAssignments();
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "loea" == sb.getMetaId() ));
       sb = e.getEventAssignment(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "ea" == sb.getMetaId() ));
 }
Beispiel #18
0
 public void test_ReadSBML_metaid()
 {
     SBase sb;
       string s = wrapSBML_L2v1("<listOfFunctionDefinitions>" +
     "  <functionDefinition metaid='fd'/>" +
     "</listOfFunctionDefinitions>" +
     "<listOfUnitDefinitions>" +
     "  <unitDefinition metaid='ud'/>" +
     "</listOfUnitDefinitions>" +
     "<listOfCompartments>" +
     "  <compartment metaid='c'/>" +
     "</listOfCompartments>" +
     "<listOfSpecies>" +
     "  <species metaid='s'/>" +
     "</listOfSpecies>" +
     "<listOfParameters>" +
     "  <parameter metaid='p'/>" +
     "</listOfParameters>" +
     "<listOfRules>" +
     "  <rateRule metaid='rr'/>" +
     "</listOfRules>" +
     "<listOfReactions>" +
     "  <reaction metaid='rx'/>" +
     "</listOfReactions>" +
     "<listOfEvents>" +
     " <event metaid='e'/>" +
     "</listOfEvents>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M != null );
       sb = M.getFunctionDefinition(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "fd" == sb.getMetaId() ));
       sb = M.getUnitDefinition(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "ud" == sb.getMetaId() ));
       sb = M.getCompartment(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "c" == sb.getMetaId() ));
       sb = M.getSpecies(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "s" == sb.getMetaId() ));
       sb = M.getParameter(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "p" == sb.getMetaId() ));
       sb = M.getRule(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "rr" == sb.getMetaId() ));
       sb = M.getReaction(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "rx" == sb.getMetaId() ));
       sb = M.getEvent(0);
       assertEquals( true, sb.isSetMetaId() );
       assertTrue((  "e" == sb.getMetaId() ));
 }
 public void test_SBMLConvertStrict_convertToL1()
 {
     SBMLDocument d = new  SBMLDocument(2,4);
       Model m = d.createModel();
       (m).setMetaId( "_m");
       Compartment c = m.createCompartment();
       c.setId( "c");
       (c).setSBOTerm(240);
       Species s = m.createSpecies();
       s.setId( "s");
       s.setCompartment( "c");
       s.setHasOnlySubstanceUnits(true);
       assertTrue( d.setLevelAndVersion(1,2,true) == true );
       assertTrue( d.getLevel() == 1 );
       assertTrue( d.getVersion() == 2 );
       Model m1 = d.getModel();
       assertTrue( (m1).getMetaId() == "" );
       Compartment c1 = m1.getCompartment(0);
       assertTrue( (c1).getSBOTerm() == -1 );
       Species s1 = m1.getSpecies(0);
       assertTrue( s1.getHasOnlySubstanceUnits() == false );
       d = null;
 }
Beispiel #20
0
 public void test_ReadSBML_notes_ListOf()
 {
     SBase sb;
       string s = wrapSBML_L2v1("<listOfFunctionDefinitions>" +
     "  <notes>My Functions</notes>" +
     "  <functionDefinition/>" +
     "</listOfFunctionDefinitions>" +
     "<listOfUnitDefinitions>" +
     "  <notes>My Units</notes>" +
     "  <unitDefinition/>" +
     "</listOfUnitDefinitions>" +
     "<listOfCompartments>" +
     "  <notes>My Compartments</notes>" +
     "  <compartment/>" +
     "</listOfCompartments>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M != null );
       sb = M.getListOfFunctionDefinitions();
       assertEquals( true, sb.isSetNotes() );
       string notes = sb.getNotes().getChild(0).getCharacters();
       assertTrue( (  "My Functions" != notes ) == false );
       sb = M.getListOfUnitDefinitions();
       assertEquals( true, sb.isSetNotes() );
       notes = sb.getNotes().getChild(0).getCharacters();
       assertTrue( (  "My Units" != notes ) == false );
       sb = M.getListOfCompartments();
       assertEquals( true, sb.isSetNotes() );
       notes = sb.getNotes().getChild(0).getCharacters();
       assertTrue( (  "My Compartments" != notes ) == false );
 }
Beispiel #21
0
 public void test_ReadSBML_AlgebraicRule()
 {
     Rule ar;
       string s = wrapSBML_L1v2("<listOfRules>" +
     "  <algebraicRule formula='x + 1'/>" +
     "</listOfRules>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumRules() == 1 );
       ar = M.getRule(0);
       assertTrue((  "x + 1" == ar.getFormula() ));
 }
Beispiel #22
0
 public void test_ReadSBML_notes_xmlns()
 {
     string s = wrapSBML_L2v3("<notes>" +
     "  <body xmlns=\"http://www.w3.org/1999/xhtml\">Some text.</body>" +
     "</notes>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNotes() != null );
       XMLNamespaces ns = M.getNotes().getChild(0).getNamespaces();
       assertTrue( ns.getLength() == 1 );
       assertTrue((  "http://www.w3.org/1999/xhtml" == ns.getURI(0) ));
       string notes = M.getNotes().getChild(0).getChild(0).getCharacters();
       assertTrue( (  "Some text." != notes ) == false );
 }
Beispiel #23
0
 public void test_SBMLDocument_setModel2()
 {
     SBMLDocument d = new  SBMLDocument(2,2);
       Model m1 = new  Model(1,2);
       int i = d.setModel(m1);
       assertTrue( i == libsbml.LIBSBML_LEVEL_MISMATCH );
       assertTrue( d.getModel() == null );
       d = null;
 }
Beispiel #24
0
 public void test_ReadSBML_Parameter()
 {
     Parameter p;
       string s = wrapSBML_L1v2("<listOfParameters>" +
     "  <parameter name='Km1' value='2.3' units='second'/>" +
     "</listOfParameters>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumParameters() == 1 );
       p = M.getParameter(0);
       assertTrue((  "Km1"     == p.getId() ));
       assertTrue((  "second"  == p.getUnits() ));
       assertTrue( p.getValue() == 2.3 );
       assertTrue( p.isSetValue() == true );
 }
Beispiel #25
0
 public void test_SBMLDocument_clone()
 {
     SBMLDocument o1 = new SBMLDocument();
       o1.setLevelAndVersion(1,1,false);
       Model m = new Model(1,1);
       m.setId("foo");
       o1.setModel(m);
       assertTrue( o1.getLevel() == 1 );
       assertTrue( o1.getVersion() == 1 );
       assertTrue( o1.getModel().getId() ==  "foo" );
       assertTrue( o1.getModel().getLevel() == 1 );
       assertTrue( o1.getModel().getVersion() == 1 );
       assertTrue( o1.getModel().getSBMLDocument() == o1 );
       SBMLDocument o2 = o1.clone();
       assertTrue( o2.getLevel() == 1 );
       assertTrue( o2.getVersion() == 1 );
       assertTrue( o2.getModel().getId() ==  "foo" );
       assertTrue( o2.getModel().getLevel() == 1 );
       assertTrue( o2.getModel().getVersion() == 1 );
       assertTrue( o2.getModel().getSBMLDocument() == o2 );
       o2 = null;
       o1 = null;
 }
Beispiel #26
0
 public void test_ReadSBML_ParameterRule()
 {
     Rule pr;
       string s = wrapSBML_L1v2("<listOfRules>" +
     "  <parameterRule name='k' formula='k3/k2'/>" +
     "</listOfRules>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumRules() == 1 );
       pr = M.getRule(0);
       assertEquals( true, pr.isParameter() );
       assertTrue((  "k" == pr.getVariable() ));
       assertTrue((  "k3/k2"  == pr.getFormula() ));
       assertTrue( pr.getType() == libsbml.RULE_TYPE_SCALAR );
 }
Beispiel #27
0
 public void test_SBMLConvert_convertToL3_localParameters()
 {
     SBMLDocument d = new  SBMLDocument(1,2);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId( "c" );
       Species s = m.createSpecies();
       s.setId( "s");
       s.setCompartment( "c");
       Reaction r = m.createReaction();
       SpeciesReference sr = r.createReactant();
       sr.setSpecies( "s");
       KineticLaw kl = r.createKineticLaw();
       kl.setFormula( "s*k");
       Parameter p = kl.createParameter();
       p.setId( "k");
       assertTrue( kl.getNumLocalParameters() == 0 );
       assertTrue( d.setLevelAndVersion(3,1,false) == true );
       m = d.getModel();
       r = m.getReaction(0);
       kl = r.getKineticLaw();
       assertTrue( kl.getNumLocalParameters() == 1 );
       LocalParameter lp = kl.getLocalParameter(0);
       d = null;
 }
Beispiel #28
0
 public void test_Model_ancestor_add()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       Model m = new Model(2,4);
       d.setModel(m);
       assertTrue( d == d.getModel().getAncestorOfType(libsbml.SBML_DOCUMENT) );
       d = null;
 }
 public void setUp()
 {
     string filename = "../../annotation/test/test-data/annotation2.xml";
       d2 = libsbml.readSBML(filename);
       m2 = d2.getModel();
 }
Beispiel #30
0
 public void test_ReadSBML_KineticLaw_Parameter()
 {
     Reaction r;
       KineticLaw kl;
       Parameter p;
       string s = wrapSBML_L1v2("<listOfReactions>" +
     "  <reaction name='J1'>" +
     "    <kineticLaw formula='k1*X0'>" +
     "      <listOfParameters>" +
     "        <parameter name='k1' value='0'/>" +
     "      </listOfParameters>" +
     "    </kineticLaw>" +
     "  </reaction>" +
     "</listOfReactions>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( M.getNumReactions() == 1 );
       r = M.getReaction(0);
       kl = r.getKineticLaw();
       assertTrue((  "k1*X0" == kl.getFormula() ));
       assertTrue( kl.getNumParameters() == 1 );
       p = kl.getParameter(0);
       assertTrue((  "k1" == p.getId() ));
       assertTrue( p.getValue() == 0 );
 }