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

Francesco Mari commented on OAK-5600:
-------------------------------------

At the end of {{CheckValidRepositoryTest#testCorrectParams}} you restore the 
stdout to the original file descriptor, but it doesn't seem to change before 
the invocation to {{CheckCommand}}. Is it correct?

At the end of {{CheckValidRepositoryTest#testCorrectParams}} and 
{{CheckValidRepositoryTest#testIncorrectParams}} you restore the stdout and 
stderr to the original file descriptor, but this is done anyway in 
{{CheckValidRepositoryTest#tearDown}}. Is the {{tearDown}} method sufficient 
for this task?

Regarding the capture of stdout, I don't like the solution with the 
{{InMemoryAppender}} because of its opaqueness, but I understand the 
pragmatism. I think that these tests could be written more clearly if they 
would exercise {{Check}} instead of {{CheckCommand}}. In this case, we could 
pass stdout and stderr to {{Check}} as {{PrintWriter}} instances that the 
command backend will use to print its output instead of using a {{Logger}}. The 
code left untested is the command line parsing logic in {{CheckCommand}}, but I 
would argue that this code is trivial enough not to deserve thorough testing at 
the moment.

> Test coverage for CheckCommand
> ------------------------------
>
>                 Key: OAK-5600
>                 URL: https://issues.apache.org/jira/browse/OAK-5600
>             Project: Jackrabbit Oak
>          Issue Type: Task
>          Components: run, segment-tar
>            Reporter: Andrei Dulceanu
>            Assignee: Andrei Dulceanu
>            Priority: Minor
>              Labels: tooling
>             Fix For: 1.7.0, 1.8
>
>         Attachments: OAK-5600.patch
>
>
> We should add tests for {{o.a.j.o.r.CheckCommand}} in order to validate 
> recent changes introduced by adding/removing options and their arguments (see 
> OAK-5275, OAK-5276, OAK-5277, OAK-5595). There is also a new feature 
> introduced by OAK-5556 (filter paths and refactoring proposed) which must be 
> thoroughly tested in order to avoid regressions.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to