public void test_SpeciesReference_Product_parent_create() { Reaction r = new Reaction(2,4); SpeciesReference sr = r.createProduct(); ListOf lo = r.getListOfProducts(); assertTrue( lo == r.getProduct(0).getParentSBMLObject() ); assertTrue( lo == sr.getParentSBMLObject() ); assertTrue( r == lo.getParentSBMLObject() ); }
public void test_Reaction_createProduct() { Reaction m = new Reaction(2,2); SpeciesReference p = m.createProduct(); assertTrue( m.getNumProducts() == 1 ); assertTrue( (p).getLevel() == 2 ); assertTrue( (p).getVersion() == 2 ); m = null; }
public void test_SpeciesReference_Product_ancestor_create() { Reaction r = new Reaction(2,4); SpeciesReference sr = r.createProduct(); ListOf lo = r.getListOfProducts(); assertTrue( sr.getAncestorOfType(libsbml.SBML_REACTION) == r ); assertTrue( sr.getAncestorOfType(libsbml.SBML_LIST_OF) == lo ); assertTrue( sr.getAncestorOfType(libsbml.SBML_DOCUMENT) == null ); assertTrue( sr.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null ); SpeciesReference obj = r.getProduct(0); assertTrue( obj.getAncestorOfType(libsbml.SBML_REACTION) == r ); assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo ); assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null ); assertTrue( obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null ); }