[jira] Commented: (ZOOKEEPER-654) Tests should not rely on CONSOLE appender being present

2010-01-22 Thread Patrick Hunt (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803950#action_12803950
 ] 

Patrick Hunt commented on ZOOKEEPER-654:


"logged at all" should be sufficient, if that works great.

regardless we should also have a dedicated log4j config file to keep any 
changes in conf from effecting the tests and their output.


> Tests should not rely on CONSOLE appender being present
> ---
>
> Key: ZOOKEEPER-654
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-654
> Project: Zookeeper
>  Issue Type: Bug
>Affects Versions: 3.2.1
>Reporter: Henry Robinson
>Priority: Minor
>
> Tests have been failing for us in an environment where we removed the CONSOLE 
> appender from log4j. This breaks a couple of tests in QuorumPeerMainTest at 
> least.
> I have fixed in our builds by replacing CONSOLE with ROLLINGFILE (which we 
> are using) for the time being, but messing with the log config shouldn't 
> break tests. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-654) Tests should not rely on CONSOLE appender being present

2010-01-22 Thread Henry Robinson (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803948#action_12803948
 ] 

Henry Robinson commented on ZOOKEEPER-654:
--

It seems like the code is retrieving a Layout object for log4j which it uses to 
format output to a custom appender. Is there a way of programmatically creating 
a Layout that will do the same thing? 

Something like this:

Layout layout = new SimpleLayout();

passes tests for me.

It depends, is the idea that we test that something is logged under the default 
log4j layout? Or that it gets logged at all (and using any layout that prints 
out messages will do)?



> Tests should not rely on CONSOLE appender being present
> ---
>
> Key: ZOOKEEPER-654
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-654
> Project: Zookeeper
>  Issue Type: Bug
>Affects Versions: 3.2.1
>Reporter: Henry Robinson
>Priority: Minor
>
> Tests have been failing for us in an environment where we removed the CONSOLE 
> appender from log4j. This breaks a couple of tests in QuorumPeerMainTest at 
> least.
> I have fixed in our builds by replacing CONSOLE with ROLLINGFILE (which we 
> are using) for the time being, but messing with the log config shouldn't 
> break tests. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-654) Tests should not rely on CONSOLE appender being present

2010-01-22 Thread Patrick Hunt (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803945#action_12803945
 ] 

Patrick Hunt commented on ZOOKEEPER-654:


it's difficult to test this particular functionality (ie verifying we log 
something in certain cases) without this approach. 

Are you saying we should have a dedicated log4j configuration file as part of 
test, rather than relying on the one in conf?
That would be fine w/me.


> Tests should not rely on CONSOLE appender being present
> ---
>
> Key: ZOOKEEPER-654
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-654
> Project: Zookeeper
>  Issue Type: Bug
>Affects Versions: 3.2.1
>Reporter: Henry Robinson
>Priority: Minor
>
> Tests have been failing for us in an environment where we removed the CONSOLE 
> appender from log4j. This breaks a couple of tests in QuorumPeerMainTest at 
> least.
> I have fixed in our builds by replacing CONSOLE with ROLLINGFILE (which we 
> are using) for the time being, but messing with the log config shouldn't 
> break tests. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.