public void test_L3_SpeciesReference_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(3,1);
       sbmlns.addNamespaces(xmlns);
       SpeciesReference sr = new  SpeciesReference(sbmlns);
       assertTrue( sr.getTypeCode() == libsbml.SBML_SPECIES_REFERENCE );
       assertTrue( sr.getMetaId() == "" );
       assertTrue( sr.getNotes() == null );
       assertTrue( sr.getAnnotation() == null );
       assertTrue( sr.getLevel() == 3 );
       assertTrue( sr.getVersion() == 1 );
       assertTrue( sr.getNamespaces() != null );
       assertTrue( sr.getNamespaces().getLength() == 2 );
       assertTrue( sr.getId() == "" );
       assertTrue( sr.getName() == "" );
       assertTrue( sr.getSpecies() == "" );
       assertEquals( true, isnan(sr.getStoichiometry()) );
       assertTrue( sr.getConstant() == false );
       assertEquals( false, sr.isSetId() );
       assertEquals( false, sr.isSetName() );
       assertEquals( false, sr.isSetSpecies() );
       assertEquals( false, sr.isSetStoichiometry() );
       assertEquals( false, sr.isSetConstant() );
       sr = null;
 }
Exemple #2
0
 public void test_Reaction_getReactant()
 {
     SpeciesReference sr1 = new  SpeciesReference(2,4);
       SpeciesReference sr2 = new  SpeciesReference(2,4);
       sr1.setSpecies( "R1");
       sr2.setSpecies( "R2");
       R.addReactant(sr1);
       R.addReactant(sr2);
       sr1 = null;
       sr2 = null;
       assertTrue( R.getNumReactants() == 2 );
       assertTrue( R.getNumProducts() == 0 );
       assertTrue( R.getNumModifiers() == 0 );
       sr1 = R.getReactant(0);
       sr2 = R.getReactant(1);
       assertTrue((  "R1" == sr1.getSpecies() ));
       assertTrue((  "R2" == sr2.getSpecies() ));
 }
 public void test_SpeciesReference_setSpecies3()
 {
     SpeciesReference c = new  SpeciesReference(2,2);
       int i = c.setSpecies( "mole");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue((  "mole" == c.getSpecies() ));
       assertEquals( true, c.isSetSpecies() );
       c = null;
 }