public void test_Model_addSpeciesType4() { Model m = new Model(2,2); SpeciesType st = new SpeciesType(2,2); st.setId( "st"); SpeciesType st1 = new SpeciesType(2,2); st1.setId( "st"); int i = m.addSpeciesType(st); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( m.getNumSpeciesTypes() == 1 ); i = m.addSpeciesType(st1); assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID ); assertTrue( m.getNumSpeciesTypes() == 1 ); st = null; st1 = null; m = null; }
public void test_Model_addSpeciesType3() { Model m = new Model(2,2); SpeciesType st = null; int i = m.addSpeciesType(st); assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED ); assertTrue( m.getNumSpeciesTypes() == 0 ); m = null; }
public void test_SpeciesType_parent_add() { SpeciesType ia = new SpeciesType(2,4); ia.setId("s"); Model m = new Model(2,4); m.addSpeciesType(ia); ia = null; ListOf lo = m.getListOfSpeciesTypes(); assertTrue( lo == m.getSpeciesType(0).getParentSBMLObject() ); assertTrue( m == lo.getParentSBMLObject() ); }
public void test_Model_addSpeciesType2() { Model m = new Model(2,2); SpeciesType st = new SpeciesType(2,3); st.setId( "st"); int i = m.addSpeciesType(st); assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH ); assertTrue( m.getNumSpeciesTypes() == 0 ); st = null; m = null; }
public void test_SpeciesType_ancestor_add() { SpeciesType ia = new SpeciesType(2,4); Model m = new Model(2,4); ia.setId("s"); m.addSpeciesType(ia); ia = null; ListOf lo = m.getListOfSpeciesTypes(); SpeciesType obj = m.getSpeciesType(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 ); }