You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/11/06 10:39:58 UTC

[jira] [Commented] (JENA-1197) riot command : provide exit codes when validating.

    [ https://issues.apache.org/jira/browse/JENA-1197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15641565#comment-15641565 ] 

ASF GitHub Bot commented on JENA-1197:
--------------------------------------

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 <br...@yahoo.com.br>
Date:   2016-11-06T10:33:59Z

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

----


> riot command : provide exit codes when validating.
> --------------------------------------------------
>
>                 Key: JENA-1197
>                 URL: https://issues.apache.org/jira/browse/JENA-1197
>             Project: Apache Jena
>          Issue Type: Improvement
>            Reporter: Andy Seaborne
>
> See discussion on user@
> https://lists.apache.org/thread.html/f2ec45ff2ddf91b39270b2c23062b92af1817c8d0ac42af928cbdb5b@%3Cusers.jena.apache.org%3E



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)