public void test_Species_setId4() { Species c = new Species(2,2); int i = c.setId( "cell"); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertEquals( true, c.isSetId() ); assertTrue(( "cell" == c.getId() )); i = c.setId(""); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertEquals( false, c.isSetId() ); c = null; }
public void test_Model_getSpecies() { Species s1 = new Species(2,4); Species s2 = new Species(2,4); s1.setId( "Glucose" ); s2.setId( "Glucose_6_P" ); s1.setCompartment( "c"); s2.setCompartment( "c"); M.addSpecies(s1); M.addSpecies(s2); assertTrue( M.getNumSpecies() == 2 ); s1 = M.getSpecies(0); s2 = M.getSpecies(1); assertTrue(( "Glucose" == s1.getId() )); assertTrue(( "Glucose_6_P" == s2.getId() )); }
public void test_L3_Species_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(3,1); sbmlns.addNamespaces(xmlns); Species s = new Species(sbmlns); assertTrue( s.getTypeCode() == libsbml.SBML_SPECIES ); assertTrue( s.getMetaId() == "" ); assertTrue( s.getNotes() == null ); assertTrue( s.getAnnotation() == null ); assertTrue( s.getLevel() == 3 ); assertTrue( s.getVersion() == 1 ); assertTrue( s.getNamespaces() != null ); assertTrue( s.getNamespaces().getLength() == 2 ); assertTrue( s.getId() == "" ); assertTrue( s.getName() == "" ); assertTrue( s.getCompartment() == "" ); assertEquals( true, isnan(s.getInitialAmount()) ); assertEquals( true, isnan(s.getInitialConcentration()) ); assertTrue( s.getSubstanceUnits() == "" ); assertTrue( s.getHasOnlySubstanceUnits() == false ); assertTrue( s.getBoundaryCondition() == false ); assertTrue( s.getConstant() == false ); assertTrue( s.getConversionFactor() == "" ); assertEquals( false, s.isSetId() ); assertEquals( false, s.isSetName() ); assertEquals( false, s.isSetCompartment() ); assertEquals( false, s.isSetInitialAmount() ); assertEquals( false, s.isSetInitialConcentration() ); assertEquals( false, s.isSetSubstanceUnits() ); assertEquals( false, s.isSetHasOnlySubstanceUnits() ); assertEquals( false, s.isSetBoundaryCondition() ); assertEquals( false, s.isSetConstant() ); assertEquals( false, s.isSetConversionFactor() ); s = null; }
public void test_L3_Species_initDefaults() { Species s = new Species(3,1); assertTrue( s.getId() == "" ); assertTrue( s.getName() == "" ); assertTrue( s.getCompartment() == "" ); assertEquals( true, isnan(s.getInitialAmount()) ); assertEquals( true, isnan(s.getInitialConcentration()) ); assertTrue( s.getSubstanceUnits() == "" ); assertTrue( s.getHasOnlySubstanceUnits() == false ); assertTrue( s.getBoundaryCondition() == false ); assertTrue( s.getConstant() == false ); assertTrue( s.getConversionFactor() == "" ); assertEquals( false, s.isSetId() ); assertEquals( false, s.isSetName() ); assertEquals( false, s.isSetCompartment() ); assertEquals( false, s.isSetInitialAmount() ); assertEquals( false, s.isSetInitialConcentration() ); assertEquals( false, s.isSetSubstanceUnits() ); assertEquals( false, s.isSetHasOnlySubstanceUnits() ); assertEquals( false, s.isSetBoundaryCondition() ); assertEquals( false, s.isSetConstant() ); assertEquals( false, s.isSetConversionFactor() ); s.initDefaults(); assertTrue( s.getId() == "" ); assertTrue( s.getName() == "" ); assertTrue( s.getCompartment() == "" ); assertEquals( true, isnan(s.getInitialAmount()) ); assertEquals( true, isnan(s.getInitialConcentration()) ); assertTrue(( "mole" == s.getSubstanceUnits() )); assertTrue( s.getHasOnlySubstanceUnits() == false ); assertTrue( s.getBoundaryCondition() == false ); assertTrue( s.getConstant() == false ); assertTrue( s.getConversionFactor() == "" ); assertEquals( false, s.isSetId() ); assertEquals( false, s.isSetName() ); assertEquals( false, s.isSetCompartment() ); assertEquals( false, s.isSetInitialAmount() ); assertEquals( false, s.isSetInitialConcentration() ); assertEquals( true, s.isSetSubstanceUnits() ); assertEquals( true, s.isSetHasOnlySubstanceUnits() ); assertEquals( true, s.isSetBoundaryCondition() ); assertEquals( true, s.isSetConstant() ); assertEquals( false, s.isSetConversionFactor() ); s = null; }
public void test_Species_copyConstructor() { Species o1 = new Species(2,4); o1.setId("c"); o1.setSpeciesType("c1"); assertTrue( o1.getId() == "c" ); assertEquals(o1.getSpeciesType(), "c1"); Species o2 = new Species(o1); assertTrue( o2.getId() == "c" ); assertEquals(o2.getSpeciesType(), "c1"); assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() ); o2 = null; o1 = null; }