@Test public void test_read_l2v1_assignment()
{
SBMLReader reader = new SBMLReader();
SBMLDocument d = null;
Model m;
Compartment c;
Species s;
Parameter gp;
LocalParameter lp;
AssignmentRule ar;
Reaction r;
SpeciesReference sr;
KineticLaw kl;
UnitDefinition ud;
Reaction r1;
ListOf<Compartment> loc;
Compartment c1;
ListOf<Rule> lor;
AssignmentRule ar1;
ListOf<Parameter> lop;
Parameter p1;
ListOf<Species> los;
Species s1;
String filename = new String( DATA_FOLDER + "/libsbml-test-data/" );
filename += "l2v1-assignment.xml";
try {
d = reader.readSBML(filename);
} catch (IOException e) {
e.printStackTrace();
assert(false);
} catch (XMLStreamException e) {
e.printStackTrace();
assert(false);
}
System.out.println(" TestReadFromFile 5: reading done.");
assertTrue( d.getLevel() == 2 );
assertTrue( d.getVersion() == 1 );
m = d.getModel();
assertTrue( m != null );
assertTrue( m.getCompartmentCount() == 1 );
c = m.getCompartment(0);
assertTrue( c != null );
assertTrue( c.getId().equals( "cell") );
/* ud = c.getDerivedUnitDefinition();
assertTrue( ud.getUnitCount() == 1 );
assertTrue( ud.getUnit(0).getKind() == Kind.LITRE );
*/
loc = m.getListOfCompartments();
c1 = loc.get(0);
assertTrue( c1.equals(c) );
c1 = loc.get("cell");
assertTrue( c1.equals(c) );
assertTrue( m.getSpeciesCount() == 5 );
s = m.getSpecies(0);
assertTrue( s != null );
assertTrue( s.getId().equals( "X0" ) );
assertTrue( s.getCompartment().equals( "cell") );