getNumErrors() public method

public getNumErrors ( ) : long
return long
Exemplo n.º 1
0
 public void test_SBMLDocument_createWith()
 {
     SBMLDocument d = new  SBMLDocument(1,2);
       assertTrue( d.getTypeCode() == libsbml.SBML_DOCUMENT );
       assertTrue( d.getNotes() == null );
       assertTrue( d.getAnnotation() == null );
       assertTrue( d.getLevel() == 1 );
       assertTrue( d.getVersion() == 2 );
       assertTrue( d.getNumErrors() == 0 );
       d = null;
 }
Exemplo n.º 2
0
 public void test_WriteSBML_error()
 {
     SBMLDocument d = new SBMLDocument();
       SBMLWriter w = new SBMLWriter();
       assertEquals( false, w.writeSBML(d, "/tmp/impossible/path/should/fail") );
       assertTrue( d.getNumErrors() == 1 );
       assertTrue( d.getError(0).getErrorId() == libsbml.XMLFileUnwritable );
       d = null;
       w = null;
 }
Exemplo n.º 3
0
 public void test_ReadSBML_notes_sbml_L2()
 {
     string s = wrapXML("<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\"> " +
     "  <notes>" +
     "    <html xmlns=\"http://www.w3.org/1999/xhtml\">" +
     "		 </html>" +
     "	  </notes>" +
     "	  <model>" +
     "   </model>" +
     " </sbml>");
       D = libsbml.readSBMLFromString(s);
       assertTrue( D.getNotes() != null );
       assertTrue( D.getNumErrors() == 0 );
 }
Exemplo n.º 4
0
 public void test_ReadSBML_notes_sbml()
 {
     string s = wrapXML("<sbml level='1' version='1'>" +
     "  <notes>Notes are not allowed as part of the SBML element.</notes>" +
     "</sbml>");
       D = libsbml.readSBMLFromString(s);
       assertTrue( D.getNotes() != null );
       string notes = D.getNotes().getChild(0).getCharacters();
       assertTrue( (  "Notes are not allowed as part of the SBML element." != notes ) == false );
       assertTrue( D.getNumErrors() > 0 );
 }
Exemplo n.º 5
0
 public void test_ReadSBML_invalid_default_namespace()
 {
     string valid = wrapXML("<sbml xmlns=\"http://www.sbml.org/sbml/level2/version4\" level=\"2\" version=\"4\"> " +
     "   <model>" +
     "     <notes>" +
     "       <p xmlns=\"http://www.w3.org/1999/xhtml\">Some text.</p>" +
     "     </notes>" +
     "     <annotation>" +
     "       <example xmlns=\"http://www.example.org/\"/>" +
     "     </annotation>" +
     "     <listOfCompartments>" +
     "       <compartment id=\"compartmentOne\" size=\"1\"/>" +
     "     </listOfCompartments>" +
     "     <listOfSpecies>" +
     "       <species id=\"S1\" initialConcentration=\"1\" compartment=\"compartmentOne\"/>" +
     "       <species id=\"S2\" initialConcentration=\"0\" compartment=\"compartmentOne\"/>" +
     "     </listOfSpecies>" +
     "     <listOfParameters>" +
     "       <parameter id=\"t\" value = \"1\" units=\"second\"/>" +
     "     </listOfParameters>" +
     "     <listOfConstraints>" +
     "       <constraint sboTerm=\"SBO:0000064\">" +
     "         <math xmlns=\"http://www.w3.org/1998/Math/MathML\">" +
     "           <apply>" +
     "             <leq/>" +
     "             <ci> S1 </ci>" +
     "             <ci> t </ci>" +
     "           </apply>" +
     "         </math>" +
     "         <message>" +
     "           <p xmlns=\"http://www.w3.org/1999/xhtml\"> Species S1 is out of range </p>" +
     "         </message>" +
     "       </constraint>" +
     "     </listOfConstraints>" +
     "     <listOfReactions>" +
     "       <reaction id=\"reaction_1\" reversible=\"false\">" +
     "           <listOfReactants>" +
     "             <speciesReference species=\"S1\"/>" +
     "           </listOfReactants>" +
     "           <listOfProducts>" +
     "             <speciesReference species=\"S2\">" +
     "             </speciesReference>" +
     "           </listOfProducts>" +
     "       </reaction>" +
     "     </listOfReactions>" +
     "   </model>" +
     " </sbml>");
       string invalid = wrapXML("<sbml xmlns=\"http://www.sbml.org/sbml/level2/version4\" level=\"2\" version=\"4\"> " +
     "   <model xmlns=\"http://invalid/custom/default/uri\">" +
     "     <notes xmlns=\"http://invalid/custom/default/uri/in/notes\">" +
     "       <p xmlns=\"http://www.w3.org/1999/xhtml\">Some text.</p>" +
     "     </notes>" +
     "     <annotation xmlns=\"http://invalid/custom/default/uri/in/annotation\">" +
     "       <example xmlns=\"http://www.example.org/\"/>" +
     "     </annotation>" +
     "     <listOfCompartments>" +
     "       <compartment id=\"compartmentOne\" size=\"1\"/>" +
     "     </listOfCompartments>" +
     "     <listOfSpecies>" +
     "       <notes xmlns=\"http://invalid/custom/default/uri/in/notes\">" +
     "         <p xmlns=\"http://www.w3.org/1999/xhtml\">Some text.</p>" +
     "       </notes>" +
     "       <annotation xmlns=\"http://invalid/custom/default/uri/in/annotation\">" +
     "         <example xmlns=\"http://www.example.org/\"/>" +
     "       </annotation>" +
     "       <species id=\"S1\" initialConcentration=\"1\" compartment=\"compartmentOne\"/>" +
     "       <species id=\"S2\" initialConcentration=\"0\" compartment=\"compartmentOne\"/>" +
     "     </listOfSpecies>" +
     "     <listOfParameters>" +
     "       <parameter id=\"t\" value = \"1\" units=\"second\"/>" +
     "     </listOfParameters>" +
     "     <listOfConstraints>" +
     "       <constraint sboTerm=\"SBO:0000064\">" +
     "         <math xmlns=\"http://www.w3.org/1998/Math/MathML\">" +
     "           <apply>" +
     "             <leq/>" +
     "             <ci> S1 </ci>" +
     "             <ci> t </ci>" +
     "           </apply>" +
     "         </math>" +
     "         <message xmlns=\"http://invalid/custom/default/uri/in/message\">" +
     "           <p xmlns=\"http://www.w3.org/1999/xhtml\"> Species S1 is out of range </p>" +
     "         </message>" +
     "       </constraint>" +
     "     </listOfConstraints>" +
     "     <listOfReactions>" +
     "       <reaction id=\"reaction_1\" reversible=\"false\">" +
     "           <listOfReactants>" +
     "             <speciesReference xmlns=\"http://invalid/custom/default/uri\" species=\"S1\"/>" +
     "           </listOfReactants>" +
     "           <listOfProducts>" +
     "             <speciesReference species=\"S2\">" +
     "               <notes xmlns=\"http://invalid/custom/default/uri/in/notes\">" +
     "                 <p xmlns=\"http://www.w3.org/1999/xhtml\">Some text.</p>" +
     "               </notes>" +
     "               <annotation xmlns=\"http://invalid/custom/default/uri/in/annotation\">" +
     "                 <example xmlns=\"http://www.example.org/\"/>" +
     "               </annotation>" +
     "             </speciesReference>" +
     "           </listOfProducts>" +
     "       </reaction>" +
     "     </listOfReactions>" +
     "   </model>" +
     " </sbml>");
       D = libsbml.readSBMLFromString(valid);
       assertTrue( D.getNumErrors() == 0 );
       D = null;
       D = libsbml.readSBMLFromString(invalid);
       assertTrue( D.getNumErrors() == 9 );
 }
Exemplo n.º 6
0
 public void test_ReadSBML_annotation_sbml_L2()
 {
     string s = wrapXML("<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\"> " +
     "  <annotation>" +
     "    <rdf xmlns=\"http://www.w3.org/1999/anything\">" +
     "		 </rdf>" +
     "	  </annotation>" +
     "	  <model>" +
     "   </model>" +
     " </sbml>");
       D = libsbml.readSBMLFromString(s);
       M = D.getModel();
       assertTrue( D.getNumErrors() == 0 );
 }
Exemplo n.º 7
0
 public void test_ReadSBML_annotation_sbml()
 {
     string s = wrapXML("<sbml level=\"1\" version=\"1\">" +
     "  <annotation xmlns:jd = \"http://www.sys-bio.org/sbml\">" +
     "    <jd:header>" +
     "      <VersionHeader SBMLVersion = \"1.0\"/>" +
     "    </jd:header>" +
     "    <jd:display>" +
     "      <SBMLGraphicsHeader BackGroundColor = \"15728639\"/>" +
     "    </jd:display>" +
     "  </annotation>" +
     "</sbml>");
       D = libsbml.readSBMLFromString(s);
       assertTrue( D.getNumErrors() > 0 );
 }