Inheritance: IDisposable
示例#1
0
 public void test_XMLError_variablesAsStrings()
 {
     XMLError error = new  XMLError(1003, "");
       assertTrue( error.getErrorId() == 1003 );
       assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_ERROR );
       assertTrue((  "Error" == error.getSeverityAsString() ));
       assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_XML );
       assertTrue((  "XML content" == error.getCategoryAsString() ));
       error = null;
 }
示例#2
0
 public void test_XMLError_create_C()
 {
     XMLError error = new  XMLError();
       assertTrue( error != null );
       assertTrue( error.isInfo() == false );
       assertTrue( error.isWarning() == false );
       assertTrue( error.isError() == false );
       assertTrue( error.isFatal() == true );
       error = null;
       error = new  XMLError(12345, "My message");
       assertTrue( (  "My message" != error.getMessage() ) == false );
       assertTrue( error.getErrorId() == 12345 );
       error = null;
 }
示例#3
0
 public void test_XMLError_create()
 {
     XMLError error = new XMLError();
       assertTrue( error != null );
       error = null;
       error = new XMLError(libsbml.DuplicateXMLAttribute);
       assertTrue( error.getErrorId() == libsbml.DuplicateXMLAttribute );
       assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_ERROR );
       assertTrue( error.getSeverityAsString() ==  "Error"  );
       assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_XML );
       assertTrue( error.getCategoryAsString() ==  "XML content" );
       assertTrue( error.getMessage() ==  "Duplicate XML attribute."  );
       assertTrue( error.getShortMessage() ==  "Duplicate attribute"  );
       error = null;
       error = new XMLError(12345, "My message");
       assertTrue( error.getErrorId() == 12345 );
       assertTrue( error.getMessage() ==  "My message"  );
       assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_FATAL );
       assertTrue( error.getSeverityAsString() ==  "Fatal"  );
       assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_INTERNAL );
       assertTrue( error.getCategoryAsString() ==  "Internal" );
       error = null;
       error = new XMLError(12345, "My message",0,0,libsbml.LIBSBML_SEV_INFO,libsbml.LIBSBML_CAT_SYSTEM);
       assertTrue( error.getErrorId() == 12345 );
       assertTrue( error.getMessage() ==  "My message"  );
       assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_INFO );
       assertTrue( error.getSeverityAsString() ==  "Informational"  );
       assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_SYSTEM );
       assertTrue( error.getCategoryAsString() ==  "Operating system" );
       assertEquals( true, error.isInfo() );
       assertEquals( true, error.isSystem() );
       error = null;
       error = new XMLError(10000, "Another message",0,0,libsbml.LIBSBML_SEV_FATAL,libsbml.LIBSBML_CAT_XML);
       assertTrue( error.getErrorId() == 10000 );
       assertTrue( error.getMessage() ==  "Another message"  );
       assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_FATAL );
       assertTrue( error.getSeverityAsString() ==  "Fatal"  );
       assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_XML );
       assertTrue( error.getCategoryAsString() ==  "XML content" );
       assertEquals( true, error.isFatal() );
       assertEquals( true, error.isXML() );
       error = null;
 }
示例#4
0
 public void test_XMLError_setters()
 {
     XMLError error = new XMLError();
       assertTrue( error != null );
       int i = error.setLine(23);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( error.getLine() == 23 );
       i = error.setColumn(45);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( error.getColumn() == 45 );
       error = null;
 }
示例#5
0
 /** */
 /* libsbml-internal */
 public void add(XMLError error)
 {
     libsbmlPINVOKE.XMLErrorLog_add__SWIG_0(swigCPtr, XMLError.getCPtr(error));
     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
 }
示例#6
0
 /**
    * Copy constructor; creates a copy of this XMLError.
    *
    * @p orig the XMLError object to copy.
    *
    * @throws @if python ValueError @else XMLConstructorException @endif
    * Thrown if the argument @p orig is @c null.
    */
 public XMLError(XMLError orig)
     : this(libsbmlPINVOKE.new_XMLError__SWIG_7(XMLError.getCPtr(orig)), true)
 {
     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
 }
示例#7
0
        internal static HandleRef getCPtrAndDisown(XMLError obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

            if (obj != null)
            {
            ptr             = obj.swigCPtr;
            obj.swigCMemOwn = false;
            }

            return ptr;
        }
示例#8
0
 internal static HandleRef getCPtr(XMLError obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }