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

Andras Salamon commented on OOZIE-3397:
---------------------------------------

[~andras.piros] I think my tests were really testing {{HttpURLConnection}} and 
not {{NotificationXCommand}}. {{NotificationXCommand}} has nothing to do with 
certificates, we should not add tests like that.

We might add unit tests for the following scenarios:
 # Good and fast connection with response code 200.
 # Good and slow ( but faster than timeout ) with response code 200
 # Good but slow ( slower than timeout ) with response code 200
 # Good connection with response code other than 200.
 # Bad connection ( {{IOException}} )

To be honest I don't really see much additional value for these tests. The 
first and third cases are already tested in 
{{TestWorkflowNotificationXCommand}} and 
{{TestCoordActionNotificationXCommand}}. {{sendNotification}} has {{void}} 
return value and it does not throw an Exception, so if we want to test it we 
need to check it we have to check the content of the log which might not be a 
good idea. Or we could extract 
[this|https://github.com/apache/oozie/blob/master/core/src/main/java/org/apache/oozie/command/NotificationXCommand.java#L110-L125]
 part of the method into a new method and test that method.

> Improve logging in NotificationXCommand
> ---------------------------------------
>
>                 Key: OOZIE-3397
>                 URL: https://issues.apache.org/jira/browse/OOZIE-3397
>             Project: Oozie
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: trunk
>            Reporter: Julia Kinga Marton
>            Assignee: Andras Salamon
>            Priority: Major
>             Fix For: 5.2.0
>
>         Attachments: OOZIE-3397-amend-01-01.patch, OOZIE-3397.001.patch, 
> OOZIE-3397.002.patch
>
>
> Around the notification sending (NotificationXCommand) there is not so much 
> logging. For example if the HTTP call fails, the error is suppressed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to