sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sqoop QA bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SQOOP-2823) Sqoop2: RESTiliency: Remove repetitive try-catch block for accessing POST and PUT request
Date Sun, 07 Feb 2016 17:57:39 GMT

    [ https://issues.apache.org/jira/browse/SQOOP-2823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15136342#comment-15136342

Sqoop QA bot commented on SQOOP-2823:

Testing file [SQOOP-2823.patch|https://issues.apache.org/jira/secure/attachment/12786590/SQOOP-2823.patch]
against branch sqoop2 took 1:22:51.103325.

{color:red}Overall:{color} -1 due to an error(s), see details below:

{color:green}SUCCESS:{color} Clean was successful
{color:green}SUCCESS:{color} Patch applied correctly
{color:red}ERROR:{color} Patch does not add/modify any test case
{color:green}SUCCESS:{color} License check passed
{color:green}SUCCESS:{color} Patch compiled
{color:green}SUCCESS:{color} All unit tests passed (executed 1700 tests)
{color:green}SUCCESS:{color} Test coverage did not decreased ([report|https://builds.apache.org/job/PreCommit-SQOOP-Build/2179/artifact/patch-process/cobertura_report.txt])
{color:green}SUCCESS:{color} No new findbugs warnings ([report|https://builds.apache.org/job/PreCommit-SQOOP-Build/2179/artifact/patch-process/findbugs_report.txt])
{color:red}ERROR:{color} Some of integration tests failed ([report|https://builds.apache.org/job/PreCommit-SQOOP-Build/2179/artifact/patch-process/test_integration.txt],
executed 0 tests)

Console output is available [here|https://builds.apache.org/job/PreCommit-SQOOP-Build/2179/console].

This message is automatically generated.

> Sqoop2: RESTiliency: Remove repetitive try-catch block for accessing POST and PUT request
> -----------------------------------------------------------------------------------------
>                 Key: SQOOP-2823
>                 URL: https://issues.apache.org/jira/browse/SQOOP-2823
>             Project: Sqoop
>          Issue Type: Bug
>            Reporter: Jarek Jarcec Cecho
>            Assignee: Jarek Jarcec Cecho
>             Fix For: 1.99.7
>         Attachments: SQOOP-2823.patch
> I've noticed that we have quite a few repetition of code like this one:
> {code}
>      RoleBean bean = new RoleBean();
>     try {
>       JSONObject json = JSONUtils.parse(ctx.getRequest().getReader());
>       bean.restore(json);
>     } catch (IOException e) {
>       throw new SqoopException(ServerError.SERVER_0003, "Can't read request content",
>     }
> {code}
> It's relatively a lot of code just because {{ctx.getRequest()}} can throw an exception.
I would like to propose to create a method in our {{ctx}} wrapper to provide the {{getReader}}
method without any exception, which will simplify the code to:
> {code}
>     bean.restore(JSONUtils.parse(ctx.getReader()));
> {code}
> We'll of course throw an exception on failure - but using our {{SqoopException}} mechanism.

This message was sent by Atlassian JIRA

View raw message