Model m;
Compartment c;
KineticLaw kl;
LocalParameter p;
Reaction r;
Species s;
SpeciesReference sr;
UnitDefinition ud;
String filename = DATA_FOLDER + "/libsbml-test-data/l1v1-branch.xml";
d = new SBMLReader().readSBML(filename);
if (d == null)
;
{
}
assertTrue(d.getLevel() == 1);
assertTrue(d.getVersion() == 1);
m = d.getModel();
assertTrue(m.getName().equals("Branch"));
assertTrue(m.getCompartmentCount() == 1);
c = m.getCompartment(0);
assertTrue(c.getName().equals("compartmentOne"));
assertTrue(c.getVolume() == 1);
ud = c.getDerivedUnitDefinition();
assertTrue(ud.getUnitCount() == 1);
// assertTrue(ud.getUnit(0).getKind() == Unit.Kind.LITRE); // getDerivedUnitDefinition not working properly
assertTrue(m.getSpeciesCount() == 4);
s = m.getSpecies(0);
assertTrue(s.getName().equals("S1"));
assertTrue(s.getCompartment().equals("compartmentOne"));
assertTrue(s.getInitialAmount() == 0);
assertTrue(s.getBoundaryCondition() == false);
// ud = s.getDerivedUnitDefinition(); // getDerivedUnitDefinition not working properly
// assertTrue(ud.getUnitCount() == 2);
// assertTrue(ud.getUnit(0).getKind() == Unit.Kind.MOLE);
// assertTrue(ud.getUnit(0).getExponent() == 1);
// assertTrue(ud.getUnit(1).getKind() == Unit.Kind.LITRE);
// assertTrue(ud.getUnit(1).getExponent() == -1);
s = m.getSpecies(1);
assertTrue(s.getName().equals("X0"));
assertTrue(s.getCompartment().equals("compartmentOne"));
assertTrue(s.getInitialAmount() == 0);
assertTrue(s.getBoundaryCondition() == true);
s = m.getSpecies(2);
assertTrue(s.getName().equals("X1"));
assertTrue(s.getCompartment().equals("compartmentOne"));
assertTrue(s.getInitialAmount() == 0);
assertTrue(s.getBoundaryCondition() == true);
s = m.getSpecies(3);
assertTrue(s.getName().equals("X2"));
assertTrue(s.getCompartment().equals("compartmentOne"));
assertTrue(s.getInitialAmount() == 0);
assertTrue(s.getBoundaryCondition() == true);
assertTrue(m.getReactionCount() == 3);
r = m.getReaction(0);
assertTrue(r.getName().equals("reaction_1"));
assertTrue(r.getReversible() == false);
assertTrue(r.getFast() == false);