public void test_Compartment_assignmentOperator() { Compartment o1 = new Compartment(2,4); o1.setId("c"); o1.setOutside("c2"); assertTrue( o1.getId() == "c" ); assertTrue( o1.getOutside() == "c2" ); Compartment o2 = new Compartment(2,4); o2 = o1; assertTrue( o2.getId() == "c" ); assertTrue( o2.getOutside() == "c2" ); assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() ); o2 = null; o1 = null; }
public void test_L3_Compartment_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(3,1); sbmlns.addNamespaces(xmlns); Compartment c = new Compartment(sbmlns); assertTrue( c.getTypeCode() == libsbml.SBML_COMPARTMENT ); assertTrue( c.getMetaId() == "" ); assertTrue( c.getNotes() == null ); assertTrue( c.getAnnotation() == null ); assertTrue( c.getLevel() == 3 ); assertTrue( c.getVersion() == 1 ); assertTrue( c.getNamespaces() != null ); assertTrue( c.getNamespaces().getLength() == 2 ); assertTrue( c.getId() == "" ); assertTrue( c.getName() == "" ); assertTrue( c.getUnits() == "" ); assertTrue( c.getOutside() == "" ); assertEquals( true, isnan(c.getSpatialDimensionsAsDouble()) ); assertEquals( true, isnan(c.getVolume()) ); assertTrue( c.getConstant() == true ); assertEquals( false, c.isSetId() ); assertEquals( false, c.isSetSpatialDimensions() ); assertEquals( false, c.isSetName() ); assertEquals( false, c.isSetSize() ); assertEquals( false, c.isSetVolume() ); assertEquals( false, c.isSetUnits() ); assertEquals( false, c.isSetOutside() ); assertEquals( false, c.isSetConstant() ); c = null; }
public void test_Compartment_setId3() { Compartment c = new Compartment(2,2); int i = c.setId( "cell"); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertEquals( true, c.isSetId() ); assertTrue(( "cell" == c.getId() )); c = null; }
public void test_Compartment_copyConstructor() { Compartment o1 = new Compartment(2,4); o1.setId("c"); o1.setOutside("c2"); assertTrue( o1.getId() == "c" ); assertTrue( o1.getOutside() == "c2" ); Compartment o2 = new Compartment(o1); assertTrue( o2.getId() == "c" ); assertTrue( o2.getOutside() == "c2" ); assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() ); o2 = null; o1 = null; }
public void test_Model_getCompartment() { Compartment c1 = new Compartment(2,4); Compartment c2 = new Compartment(2,4); c1.setId( "A"); c2.setId( "B"); M.addCompartment(c1); M.addCompartment(c2); assertTrue( M.getNumCompartments() == 2 ); c1 = M.getCompartment(0); c2 = M.getCompartment(1); assertTrue(( "A" == c1.getId() )); assertTrue(( "B" == c2.getId() )); }