GitHub user kinow opened a pull request:

    https://github.com/apache/jena/pull/188

    JENA-1197 return exit code 1 when there is a problem validating a file with 
riot

    A pull request with a simple approach for JENA-1197. When validate is 
checked, errors parsing a file will also be reported back, through a 
`CmdException`.
    
    Quite hard to write a unit test for this, so did some simple regression 
test locally.
    
    ```
    kinow@localhost:~/Development/java/jena/jena/apache-jena/bin$ 
JENA_HOME=/home/kinow/Desktop/JENA/apache-jena-3.1.1 ./riot --validate 
/tmp/invalid.ttl ; echo $?
    23:34:46 ERROR riot                 :: [line: 1, col: 1 ] Out of place: 
[KEYWORD:I]
    0
    kinow@localhost:~/Development/java/jena/jena/apache-jena/bin$ 
JENA_HOME=../target/apache-jena-3.1.2-SNAPSHOT ./riot --validate 
/tmp/invalid.ttl ; echo $?
    23:34:55 ERROR riot                 :: [line: 1, col: 1 ] Out of place: 
[KEYWORD:I]
    1
    kinow@localhost:~/Development/java/jena/jena/apache-jena/bin$ 
JENA_HOME=/home/kinow/Desktop/JENA/apache-jena-3.1.1 ./riot --validate 
../../jena-sdb/testing/Assembler/graph-assembler.ttl ; echo $?
    0
    kinow@localhost:~/Development/java/jena/jena/apache-jena/bin$ 
JENA_HOME=../target/apache-jena-3.1.2-SNAPSHOT ./riot --validate 
../../jena-sdb/testing/Assembler/graph-assembler.ttl ; echo $?
    0
    ```
    
    For invalid files, the new code prints the same as before, but exists with 
1, rather than 0. For valid files, the behavior is consistent too.
    
    Sending a pull request as we are in the middle of a release :-)
    
    Cheers
    Bruno


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kinow/jena JENA-1197

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/jena/pull/188.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #188
    
----
commit 79943f05f4e9040da954f26f22113af9ff36f33f
Author: Bruno P. Kinoshita <[email protected]>
Date:   2016-11-06T10:33:59Z

    JENA-1197 return exit code 1 when there is a problem validating a file with 
riot

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to