public void test_L3_Compartment_initDefaults() { Compartment c = new Compartment(3, 1); c.setId("A"); assertEquals(true, c.isSetId()); assertEquals(false, c.isSetName()); assertEquals(false, c.isSetSize()); assertEquals(false, c.isSetVolume()); assertEquals(false, c.isSetUnits()); assertEquals(false, c.isSetConstant()); assertEquals(false, c.isSetSpatialDimensions()); c.initDefaults(); assertTrue(("A" == c.getId())); assertTrue(c.getName() == ""); assertTrue(("litre" == c.getUnits())); assertTrue(c.getSpatialDimensions() == 3); assertTrue(c.getSize() == 1); assertTrue(c.getConstant() == true); assertEquals(true, c.isSetId()); assertEquals(false, c.isSetName()); assertEquals(false, c.isSetSize()); assertEquals(false, c.isSetVolume()); assertEquals(true, c.isSetUnits()); assertEquals(true, c.isSetConstant()); assertEquals(true, c.isSetSpatialDimensions()); c = 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_L3_Compartment_create() { assertTrue(C.getTypeCode() == libsbml.SBML_COMPARTMENT); assertTrue(C.getMetaId() == ""); assertTrue(C.getNotes() == null); assertTrue(C.getAnnotation() == null); 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()); }