cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "SANSONE, AARON M [Non-Pharmacia/1000]" <aaron.m.sans...@monsanto.com>
Subject JUnit Testing Actions with Logging...
Date Fri, 19 Oct 2001 15:51:21 GMT
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

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message