Esempio n. 1
0
        public void test_CompartmentType_ancestor_add()
        {
            CompartmentType ct = new CompartmentType(2, 4);
            Model           m  = new Model(2, 4);

            ct.setId("ct");
            m.addCompartmentType(ct);
            ct = null;
            ListOf          lo  = m.getListOfCompartmentTypes();
            CompartmentType obj = m.getCompartmentType(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);
        }
Esempio n. 2
0
        public void test_CompartmentType_ancestor_create()
        {
            Model           m  = new Model(2, 4);
            CompartmentType ct = m.createCompartmentType();
            ListOf          lo = m.getListOfCompartmentTypes();

            assertTrue(ct.getAncestorOfType(libsbml.SBML_MODEL) == m);
            assertTrue(ct.getAncestorOfType(libsbml.SBML_LIST_OF) == lo);
            assertTrue(ct.getAncestorOfType(libsbml.SBML_DOCUMENT) == null);
            assertTrue(ct.getAncestorOfType(libsbml.SBML_EVENT) == null);
            CompartmentType obj = m.getCompartmentType(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_CompartmentType_parent_NULL()
        {
            SBMLDocument    d  = new SBMLDocument(2, 4);
            Model           m  = d.createModel();
            CompartmentType c  = m.createCompartmentType();
            CompartmentType c1 = c.clone();

            d = null;
            assertTrue(c1.getAncestorOfType(libsbml.SBML_MODEL) == null);
            assertTrue(c1.getParentSBMLObject() == null);
            assertEquals(c1.getSBMLDocument(), null);
            c1 = null;
        }