sbmlteam / jsbml

JSBML is a community-driven project to create a free, open-source, pure Java™ library for reading, writing, and manipulating SBML files (the Systems Biology Markup Language) and data streams. It is an alternative to the mixed Java/native code-based interface provided in libSBML.
https://sbml.org/software/jsbml/
GNU Lesser General Public License v2.1
37 stars 24 forks source link

story #154807739: make clear if we encounter package that has partial or no validation support #206

Closed Onur101010 closed 4 years ago

niko-rodrigue commented 4 years ago

Have you tested it with several xml files to see if the proper error is thrown and if it is not thrown when it should not. You could create two folders that we will add into the set of validations files, name it like the others files with some fail and pass files

Onur101010 commented 4 years ago

t. You could create two folders that we will add into the set of validations files, name it like the others files with some fail and pass file

No not yet, okay I'll start and keep you updated.

Onur101010 commented 4 years ago

Is it sufficient that the first activated package of the document with no validation leads the constraint to be broken? Or do we want to have all packages to have no support to break the constraint 70001?

Onur101010 commented 4 years ago

Okay perfect, then you can maybe doublecheck the validator with the new folders, it seems to work now.

niko-rodrigue commented 4 years ago

Yes, it is working but I would like, as an exercise that you put the two ValidationFunctions into one to see if you understood correctly how it is working and to show later on an example of a ValidationFunction that handle several validation errors at the same time.

On Tue, 7 Apr 2020 at 15:39, Onur101010 notifications@github.com wrote:

Okay perfect, then you can maybe doublecheck the validator with the new folders, it seems to work now.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sbmlteam/jsbml/pull/206#issuecomment-610426138, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMVB4LMEXNZPMR7HVOBBULRLM3LZANCNFSM4L27KESA .

Onur101010 commented 4 years ago

Is something like this what you mean ? Both error codes use same function now. Or do you want to validate partial support and no support codes in one go?

niko-rodrigue commented 4 years ago

You are almost there. Here, you are re-using the same ValidationFunction twice, which is already good. What I want is to have only one ValidationFunction, called only once (meaning, you can remove the 'case CORE_70002:'). And then, in the implementation of the validationFunction, you are not allowed to test for the error code or to use CORE_70001 or CORE_70002 !

niko-rodrigue commented 4 years ago

Perfect, see how it make the method much simpler.

Last small details, please add a small comment(s) to explain that you are doing both errors in the same method. Also, you now can remove CORE_70002 from addErrorCodesForCheck.