addReactant() public method

public addReactant ( Species species ) : int
species Species
return int
Ejemplo n.º 1
0
 public void test_Reaction_addReactant4()
 {
     Reaction m = new  Reaction(2,2);
       SpeciesReference p = null;
       int i = m.addReactant(p);
       assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED );
       assertTrue( m.getNumReactants() == 0 );
       m = null;
 }
Ejemplo n.º 2
0
 public void test_Reaction_addReactant3()
 {
     Reaction m = new  Reaction(2,2);
       SpeciesReference p = new  SpeciesReference(1,2);
       p.setSpecies( "k");
       int i = m.addReactant(p);
       assertTrue( i == libsbml.LIBSBML_LEVEL_MISMATCH );
       assertTrue( m.getNumReactants() == 0 );
       p = null;
       m = null;
 }
Ejemplo n.º 3
0
 public void test_SpeciesReference_Reactant_parent_add()
 {
     SpeciesReference sr = new SpeciesReference(2,4);
       Reaction r = new Reaction(2,4);
       sr.setSpecies("s");
       r.addReactant(sr);
       sr = null;
       ListOf lo = r.getListOfReactants();
       assertTrue( lo == r.getReactant(0).getParentSBMLObject() );
       assertTrue( r == lo.getParentSBMLObject() );
 }
Ejemplo n.º 4
0
 public void test_Reaction_addReactant1()
 {
     Reaction m = new  Reaction(2,2);
       SpeciesReference p = new  SpeciesReference(2,2);
       SpeciesReference p1 = new  SpeciesReference(2,2);
       p1.setSpecies( "k");
       p1.setId( "k1");
       int i = m.addReactant(p);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       p.setSpecies( "k");
       p.setId( "k1");
       i = m.addReactant(p);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumReactants() == 1 );
       i = m.addReactant(p1);
       assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID );
       assertTrue( m.getNumReactants() == 1 );
       p1 = null;
       p = null;
       m = null;
 }
Ejemplo n.º 5
0
 public void test_SpeciesReference_Reactant_ancestor_add()
 {
     SpeciesReference sr = new SpeciesReference(2,4);
       Reaction r = new Reaction(2,4);
       sr.setSpecies("s");
       r.addReactant(sr);
       sr = null;
       ListOf lo = r.getListOfReactants();
       SpeciesReference obj = r.getReactant(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_REACTION) == r );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
 }