public void test_SpeciesReference_Reactant_parent_create() { Reaction r = new Reaction(2,4); SpeciesReference sr = r.createReactant(); ListOf lo = r.getListOfReactants(); assertTrue( lo == r.getReactant(0).getParentSBMLObject() ); assertTrue( lo == sr.getParentSBMLObject() ); assertTrue( r == lo.getParentSBMLObject() ); }
public void test_SpeciesReference_Reactant_ancestor_create() { Reaction r = new Reaction(2,4); SpeciesReference sr = r.createReactant(); ListOf lo = r.getListOfReactants(); 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.getReactant(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 ); }
public void test_SpeciesReference_Reactant_parent_add() { SpeciesReference sr = new SpeciesReference(2,4); Reaction r = new Reaction(2,4); sr.setSpecies("s"); r.addReactant(sr); sr = null; ListOf lo = r.getListOfReactants(); assertTrue( lo == r.getReactant(0).getParentSBMLObject() ); assertTrue( r == lo.getParentSBMLObject() ); }
public void test_SpeciesReference_Reactant_ancestor_add() { SpeciesReference sr = new SpeciesReference(2,4); Reaction r = new Reaction(2,4); sr.setSpecies("s"); r.addReactant(sr); sr = null; ListOf lo = r.getListOfReactants(); SpeciesReference obj = r.getReactant(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 ); }