public void test_SBMLError_create() { SBMLError error = new SBMLError(); assertTrue( error != null ); error = null; error = new SBMLError(libsbml.EmptyListInReaction); assertTrue( error.getErrorId() == libsbml.EmptyListInReaction ); assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_ERROR ); assertTrue( error.getSeverityAsString() == "Error" ); assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_SBML ); assertTrue( error.getCategoryAsString() == "General SBML conformance" ); error = null; error = new SBMLError(libsbml.OverdeterminedSystem,2,1); assertTrue( error.getErrorId() == libsbml.OverdeterminedSystem ); assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_WARNING ); assertTrue( error.getSeverityAsString() == "Warning" ); assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_SBML ); assertTrue( error.getCategoryAsString() == "General SBML conformance" ); error = null; error = new SBMLError(libsbml.OffsetNoLongerValid,2,2); assertTrue( error.getErrorId() == libsbml.OffsetNoLongerValid ); assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_ERROR ); assertTrue( error.getSeverityAsString() == "Error" ); assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_GENERAL_CONSISTENCY ); assertTrue( error.getCategoryAsString() == "SBML component consistency" ); error = null; error = new SBMLError(libsbml.NoSBOTermsInL1,2,2); assertTrue( error.getErrorId() == libsbml.NoSBOTermsInL1 ); assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_WARNING ); assertTrue( error.getSeverityAsString() == "Warning" ); assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_SBML_L1_COMPAT ); assertTrue( error.getCategoryAsString() == "Translation to SBML L1V2" ); error = null; error = new SBMLError(libsbml.DisallowedMathMLEncodingUse,2,2); assertTrue( error.getErrorId() == libsbml.DisallowedMathMLEncodingUse ); assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_ERROR ); assertTrue( error.getSeverityAsString() == "Error" ); assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_MATHML_CONSISTENCY ); assertTrue( error.getShortMessage() == "Disallowed use of MathML 'encoding' attribute" ); error = null; error = new SBMLError(libsbml.DisallowedMathMLEncodingUse,1,2); assertTrue( error.getErrorId() == libsbml.DisallowedMathMLEncodingUse ); assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_NOT_APPLICABLE ); assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_MATHML_CONSISTENCY ); error = null; error = new SBMLError(libsbml.UnknownError,2,4); assertTrue( error.getErrorId() == libsbml.UnknownError ); assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_FATAL ); assertTrue( error.getSeverityAsString() == "Fatal" ); assertTrue( error.getCategory() == libsbml.LIBSBML_CAT_INTERNAL ); assertTrue( error.getShortMessage() == "Unknown internal libSBML error" ); error = null; }
/** * Adds the given failure to this list of Validators failures. * * @param err an SBMLError object representing an error or warning * * @if clike @see getFailures() @endif */ public void logFailure(SBMLError err) { libsbmlPINVOKE.SBMLValidator_logFailure(swigCPtr, SBMLError.getCPtr(err)); if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); }
internal static HandleRef getCPtrAndDisown(SBMLError obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return ptr; }
internal static HandleRef getCPtr(SBMLError obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
/** * Copy constructor; creates a copy of this SBMLError. */ public SBMLError(SBMLError orig) : this(libsbmlPINVOKE.new_SBMLError__SWIG_11(SBMLError.getCPtr(orig)), true) { if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); }
/** */ /* libsbml-internal */ public void add(SBMLError error) { libsbmlPINVOKE.SBMLErrorLog_add(swigCPtr, SBMLError.getCPtr(error)); if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); }