You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Chris K Chew <ch...@fenetics.com> on 2002/09/25 00:21:45 UTC

Set up RunData in Junit Tests?

Hello.

Does anybody have any suggestions for getting a RunData object sufficient
for the TemplateLink object in a Junit test?  I am using the second
(AllTests) method described in the App Testing section of the TDK site.

I have tried:

	RunData data = new DefaultTurbineRunData();

and

	MockControl rdCtl = EasyMock.controlFor(RunData.class);
	RunData data = (RunData)rdCtl.getMock();

But both give me a NullPointerException:

java.lang.NullPointerException
at org.apache.turbine.util.DynamicURI.init(DynamicURI.java:634)
at org.apache.turbine.util.DynamicURI.init(DynamicURI.java:341)
at org.apache.turbine.util.DynamicURI.init(DynamicURI.java:328)
at org.apache.turbine.util.DynamicURI.<init>(DynamicURI.java:155)
at
org.apache.turbine.util.template.TemplateLink.<init>(TemplateLink.java:106)
at com.fitmyschedule.tests.FmsLinkToolTest.testLinkNewUser(Unknown Source)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
at junit.extensions.TestSetup.run(TestSetup.java:23)

Line 634 of DynamicURI calls getServerScheme() on ServerData, so I am
guessing that
ServerData isn't correctly populated (i.e. null).

Thanks in advance,

Chris


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>