public void test_Unit_parent_create()
        {
            UnitDefinition ud = new UnitDefinition(2, 4);
            Unit           u  = ud.createUnit();

            assertTrue(ud.getNumUnits() == 1);
            ListOf lo = ud.getListOfUnits();

            assertTrue(lo == ud.getUnit(0).getParentSBMLObject());
            assertTrue(lo == u.getParentSBMLObject());
            assertTrue(ud == lo.getParentSBMLObject());
            ud = null;
        }
        public void test_Unit_parent_add()
        {
            UnitDefinition ud = new UnitDefinition(2, 4);
            Unit           u  = new Unit(2, 4);

            u.setKind(libsbml.UNIT_KIND_MOLE);
            ud.addUnit(u);
            u = null;
            assertTrue(ud.getNumUnits() == 1);
            ListOf lo = ud.getListOfUnits();

            assertTrue(lo == ud.getUnit(0).getParentSBMLObject());
            assertTrue(ud == lo.getParentSBMLObject());
            ud = null;
        }
Exemplo n.º 3
0
        public void test_Unit_ancestor_add()
        {
            UnitDefinition ud = new UnitDefinition(2, 4);
            Unit           u  = new Unit(2, 4);

            u.setKind(libsbml.UNIT_KIND_MOLE);
            ud.addUnit(u);
            u = null;
            assertTrue(ud.getNumUnits() == 1);
            ListOf lo  = ud.getListOfUnits();
            Unit   obj = ud.getUnit(0);

            assertTrue(obj.getAncestorOfType(libsbml.SBML_UNIT_DEFINITION) == ud);
            assertTrue(obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo);
            assertTrue(obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null);
            assertTrue(obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null);
            ud = null;
        }
Exemplo n.º 4
0
        public void test_Unit_ancestor_create()
        {
            UnitDefinition ud = new UnitDefinition(2, 4);
            Unit           u  = ud.createUnit();

            assertTrue(ud.getNumUnits() == 1);
            ListOf lo = ud.getListOfUnits();

            assertTrue(u.getAncestorOfType(libsbml.SBML_UNIT_DEFINITION) == ud);
            assertTrue(u.getAncestorOfType(libsbml.SBML_LIST_OF) == lo);
            assertTrue(u.getAncestorOfType(libsbml.SBML_DOCUMENT) == null);
            assertTrue(u.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null);
            Unit obj = ud.getUnit(0);

            assertTrue(obj.getAncestorOfType(libsbml.SBML_UNIT_DEFINITION) == ud);
            assertTrue(obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo);
            assertTrue(obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null);
            assertTrue(obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null);
            ud = null;
        }