Hello everyone,

In Cocoon2 has anyone successfully configured a JUnit test case that will
run an Action (or any other class) that has logging method calls in it? 

For example, I have an action that I am able to Unit test with out any
problem until I add the following (line 45):

    getLogger().debug("CheckBoxAggregateAction: parameter useCheckedValue =
" + params.getParameter("useCheckedValue", "FALSE") );

After adding this line, my JUnit tests fail with the following exception:

java.lang.NullPointerException  
        at
com.test.acting.CheckBoxAggregateAction.act(CheckBoxAggregateAction.java:45)

        at
com.test.acting.test.UnitTest_CheckboxAggregateAction.testUseCheckedValue(Un
itTest_CheckboxAggregateAction.java:68) 

Apparently this is failing because I can't get a Logger.  I don't want to
create a logger in the Action and I can run the action successfully within
the Cocoon2 Framework. 
How do I setup my TestCase to create a logger so that my Unit Tests will
work?

Thanks in advance,

Aaron

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to