Ejemplo n.º 1
0
        public void test_InitialAssignment_ancestor_create()
        {
            Model             m  = new Model(2, 4);
            InitialAssignment ia = m.createInitialAssignment();
            ListOf            lo = m.getListOfInitialAssignments();

            assertTrue(ia.getAncestorOfType(libsbml.SBML_MODEL) == m);
            assertTrue(ia.getAncestorOfType(libsbml.SBML_LIST_OF) == lo);
            assertTrue(ia.getAncestorOfType(libsbml.SBML_DOCUMENT) == null);
            assertTrue(ia.getAncestorOfType(libsbml.SBML_EVENT) == null);
            InitialAssignment obj = m.getInitialAssignment(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);
        }
Ejemplo n.º 2
0
        public void test_InitialAssignment_ancestor_add()
        {
            InitialAssignment ia = new InitialAssignment(2, 4);
            Model             m  = new Model(2, 4);

            ia.setSymbol("c");
            ia.setMath(libsbml.parseFormula("9"));
            m.addInitialAssignment(ia);
            ia = null;
            ListOf            lo  = m.getListOfInitialAssignments();
            InitialAssignment obj = m.getInitialAssignment(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_InitialAssignment_parent_NULL()
        {
            SBMLDocument      d  = new SBMLDocument();
            Model             m  = d.createModel();
            InitialAssignment c  = m.createInitialAssignment();
            InitialAssignment c1 = c.clone();

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