Issue Details (XML | Word | Printable)

Key: MYSTIC_APPS-1
Type: Task Task
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: jasonwhaley
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mystic-apps

testRenderMyPage unit test fails

Created: 08/Jul/09 01:18 AM   Updated: 08/Jul/09 02:13 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. File TestPastePage.diff (3 kB) 08/Jul/09 02:13 AM - jasonwhaley

Environment:

> mvn -version
Apache Maven 2.2.0 (r788681; 2009-06-26 09:04:01-0400)
Java version: 1.6.0_13
Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.5.7" arch: "x86_64" Family: "mac"


Tags:


 Description  « Hide

-------------------------------------------------------------------------------
Test set: com.mysticcoders.webapp.TestPastePage
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.845 sec <<< FAILURE!
testRenderMyPage(com.mysticcoders.webapp.TestPastePage) Time elapsed: 3.461 sec <<< ERROR!
org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor public com.mysticcoders.mysticpaste.web.pages.view.ViewPublicPage(org.apache.wicket.PageParameters) and argument 0 = "1"
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:88)
at org.apache.wicket.protocol.http.MockWebApplication.generateLastRenderedPage(MockWebApplication.java:572)
at org.apache.wicket.protocol.http.MockWebApplication.postProcessRequestCycle(MockWebApplication.java:517)
at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:497)
at org.apache.wicket.util.tester.FormTester.submit(FormTester.java:617)
at com.mysticcoders.webapp.TestPastePage.testRenderMyPage(TestPastePage.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:66)
at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:105)
at org.unitils.UnitilsJUnit4TestClassRunner$CustomMethodRoadie.runTestMethod(UnitilsJUnit4TestClassRunner.java:188)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:86)
at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:94)
at org.unitils.UnitilsJUnit4TestClassRunner$CustomMethodRoadie.runBeforesThenTestThenAfters(UnitilsJUnit4TestClassRunner.java:168)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
at org.unitils.UnitilsJUnit4TestClassRunner.invokeTestMethod(UnitilsJUnit4TestClassRunner.java:127)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:59)
at org.unitils.UnitilsJUnit4TestClassRunner.access$000(UnitilsJUnit4TestClassRunner.java:42)
at org.unitils.UnitilsJUnit4TestClassRunner$1.run(UnitilsJUnit4TestClassRunner.java:87)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
at org.unitils.UnitilsJUnit4TestClassRunner.run(UnitilsJUnit4TestClassRunner.java:94)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:147)
... 35 more
Caused by: java.lang.IllegalStateException: bean of type [com.mysticcoders.mysticpaste.persistence.PasteCommentDao] not found
at org.apache.wicket.spring.SpringBeanLocator.getBeanNameOfClass(SpringBeanLocator.java:107)
at org.apache.wicket.spring.SpringBeanLocator.getBeanName(SpringBeanLocator.java:192)
at org.apache.wicket.spring.SpringBeanLocator.isSingletonBean(SpringBeanLocator.java:133)
at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:90)
at org.apache.wicket.injection.Injector.inject(Injector.java:108)
at org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39)
at org.apache.wicket.injection.ComponentInjector.onInstantiation(ComponentInjector.java:52)
at org.apache.wicket.Application.notifyComponentInstantiationListeners(Application.java:974)
at org.apache.wicket.Component.<init>(Component.java:873)
at org.apache.wicket.MarkupContainer.<init>(MarkupContainer.java:105)
at org.apache.wicket.Page.<init>(Page.java:235)
at org.apache.wicket.markup.html.WebPage.<init>(WebPage.java:184)
at com.mysticcoders.mysticpaste.web.pages.BasePage.<init>(BasePage.java:22)
at com.mysticcoders.mysticpaste.web.pages.view.ViewPastePage.<init>(ViewPastePage.java:53)
at com.mysticcoders.mysticpaste.web.pages.view.ViewPublicPage.<init>(ViewPublicPage.java:30)
... 40 more



jasonwhaley added a comment - 08/Jul/09 02:13 AM

The following diff resolves it.

1) PasteCommentDao needed to be annotated for unitils to place in the test spring context
2) the 0th index of the language type changed to as3 (for apple script). The assertLabel needed to be updated to take that in to account.

I'll merge this in to the central repo if ok with you guys.