public void test_Compartment_ancestor_create() { Model m = new Model(2, 4); Compartment c = m.createCompartment(); ListOf lo = m.getListOfCompartments(); assertTrue(c.getAncestorOfType(libsbml.SBML_MODEL) == m); assertTrue(c.getAncestorOfType(libsbml.SBML_LIST_OF) == lo); assertTrue(c.getAncestorOfType(libsbml.SBML_DOCUMENT) == null); assertTrue(c.getAncestorOfType(libsbml.SBML_EVENT) == null); Compartment obj = m.getCompartment(0); assertTrue(obj.getAncestorOfType(libsbml.SBML_MODEL) == m); assertTrue(obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo); assertTrue(obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null); assertTrue(obj.getAncestorOfType(libsbml.SBML_EVENT) == null); }
public void test_Compartment_ancestor_add() { Compartment c = new Compartment(2, 4); c.setId("C"); Model m = new Model(2, 4); m.addCompartment(c); c = null; ListOf lo = m.getListOfCompartments(); Compartment obj = m.getCompartment(0); assertTrue(obj.getAncestorOfType(libsbml.SBML_MODEL) == m); assertTrue(obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo); assertTrue(obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null); assertTrue(obj.getAncestorOfType(libsbml.SBML_EVENT) == null); }
public void test_Compartment_parent_NULL() { SBMLDocument d = new SBMLDocument(); Model m = d.createModel(); Compartment c = m.createCompartment(); Compartment c1 = c.clone(); d = null; assertTrue(c1.getAncestorOfType(libsbml.SBML_MODEL) == null); assertTrue(c1.getParentSBMLObject() == null); assertEquals(c1.getSBMLDocument(), null); c1 = null; }