Wicket + Spring
Hi all, Im just trying to setup a basic project structure in Eclipse with Wicket and Spring. I think its pretty smart to separate both Wicket and Spring into two different Eclipse projects, isnt it? Thus, I created an Eclipse project for the Web part and one for the Spring (and later Hibernate as well) part. Now when I start Tomcat with Eclipse I get ...Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ConfigurableApplicationContext Thats not rocket science. After adding the corresponding Spring lib to the WEB-INF/lib folder another error message appears after server startup telling me that another class is missing from a different jar. Probably I will end up adding all Spring jars into my WEB-INF/lib folder. But thats not what I what. I dont want to add any Spring Core jar in my Web project (Reasons should be clear). I already added all Spring related jars into my different Spring Eclipse project. Any suggestions. Cheers, Y - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Re: Re: Re: Basic JUnit Test
What exactly do you mean by 'quickstart' ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Re: Re: Re: Re: Basic JUnit Test
What exactly do you mean by 'quickstart' ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Re: Re: Basic JUnit Test
Hi Vineet, thanks for the reply. The line tester.getServletRequest().setParameter(myParam, testParam); But now Im breaking my head with the next issue. If you look at my first post, Im trying to do a test where a second page is rendered after a submit on an AjaxButton. The test code looks like this: 1. FirstPage page = (FirstPage) tester.startPage(FirstPage.class, pageParameters); 2. tester.assertRenderedPage(FirstPage.class); 3. page.getActionForm().setType(1); // where actionForm is a property/attribute of FirstPage. 4. FormTester formTester = tester.newFormTester(myForm); 5. tester.getServletRequest().setParameter(myParam, testParam); 6. tester.executeAjaxEvent(myForm:myAjaxButton, onclick); 7. tester.assertRenderedPage(SecondPage.class); The the test fails within the onSubmit(AjaxRequestTarget target, Form? form) saying that the attribute/property actionForm is null... Obviously the second (Ajax-) request is not shipped with the attribute/property values of his containing panel. Is this correct? Who can help me out here? Regards, Yusuf - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Re: Basic JUnit Test
Hi Vineet, wickettester#ajaxEvent(button,onclick) is what I already tried. And it worked better but not finally finsihed. The cause of the next problem is that I need to provide some request parameter for this request since my application reads request and throws an exception if it can't find special parameters. Then I changed my code to provide some ajax request parameter because the button click is an instance of AjaxButton: Component comp = tester .getComponentFromLastRenderedPage(myForm:myAjaxButton); AjaxEventBehavior behavior = new AjaxFormSubmitBehavior(onclick) { @Override protected void onSubmit(AjaxRequestTarget target) { System.out.println(hh); } @Override protected void onError(AjaxRequestTarget target) { // TODO Auto-generated method stub } }; comp.add(behavior); tester.executeAjaxEvent(comp, onclick); Is this the correct to provide ajax request parameter? If so, I guess I need to chance something in onSubmit(AjaxRequestTarget), true ? Regards, Y - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Basic JUnit Test
Well it turns out that reflective call of a method failes. I run into WicketRuntimeException in RequestListenerInterface.invoke(Page, Component). The button to submit is an instance of AjaxButton. Does this make a difference in initializing the test? Regards, Y - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Basic JUnit Test
Furthermore, I found out that my test code calls public void onSubmit(); instead of calling the overridden protected void onSubmit(AjaxRequestTarget target, Form? form); These overriden methods reside in my anonymous inner subclass of AjaxButton. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Basic JUnit Test
Hi all, Im working at a basic Unit Test that looks like this: 1. tester.assertRenderedPage(FirstPage.class); 2. FormTester formTester = tester.newFormTester(myForm); 3. formTester.submit(myButton); 4. tester.assertRenderedPage(SecondPage.class); All lines work as expected. Only line 4 fails. I just want to verify a click on a button and after that a certain Page (SecondPage) should be rendered. The test fails with: junit.framework.AssertionFailedError: expected:SecondPage but was:FirstPage What did I wrong? Cheers Thanks in advance, Y - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org