Re: [Wicket-user] Unit test fail probably cause by authenication
I am really sorry, after detail tracing system, I found that there is some parts of code will throw RestartResponseAtInterceptPageException... On 12/27/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > set a breakpoint in your auth strategy and see what it is doing, sounds like > a bug in there > > -igor > > > On 12/26/06, Carfield Yim < [EMAIL PROTECTED]> wrote: > > > > On 12/27/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote: > > > well looks like you are expecting main page but getting a login? so your > > > auth strategy is redirecting, thus the test fails > > > > > But for the unit test session, I already did below: > > > > public static class Tester extends WicketTester { > > @Override > > protected ISessionFactory getSessionFactory() { > > return new ISessionFactory() { > > public Session newSession() { > > com.genuco.util.component.Session > session = new > > com.component.Session(Tester.this); > > session.setAuthenticated(true); > > return session; > > } > > }; > > } > > } > > > > So the auth should be bypassed, do you have any idea that why I still > > getting this error? > > > > > - > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys - and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Unit test fail probably cause by authenication
set a breakpoint in your auth strategy and see what it is doing, sounds like a bug in there -igor On 12/26/06, Carfield Yim <[EMAIL PROTECTED]> wrote: On 12/27/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > well looks like you are expecting main page but getting a login? so your > auth strategy is redirecting, thus the test fails > But for the unit test session, I already did below: public static class Tester extends WicketTester { @Override protected ISessionFactory getSessionFactory() { return new ISessionFactory() { public Session newSession() { com.genuco.util.component.Session session = new com.component.Session(Tester.this); session.setAuthenticated(true); return session; } }; } } So the auth should be bypassed, do you have any idea that why I still getting this error? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Unit test fail probably cause by authenication
On 12/27/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > well looks like you are expecting main page but getting a login? so your > auth strategy is redirecting, thus the test fails > But for the unit test session, I already did below: public static class Tester extends WicketTester { @Override protected ISessionFactory getSessionFactory() { return new ISessionFactory() { public Session newSession() { com.genuco.util.component.Session session = new com.component.Session(Tester.this); session.setAuthenticated(true); return session; } }; } } So the auth should be bypassed, do you have any idea that why I still getting this error? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Unit test fail probably cause by authenication
well looks like you are expecting main page but getting a login? so your auth strategy is redirecting, thus the test fails -igor On 12/26/06, Carfield Yim <[EMAIL PROTECTED]> wrote: Anyone have any idea? On 12/22/06, Carfield Yim <[EMAIL PROTECTED]> wrote: > The unit test is just create a WebPage and assert it, stacktrace as > below and look like the authenication will forward to Logon page if it > is not authenication . However, in the session I have set it always > return true if it is unit test. Anybody have any idea? > > junit.framework.ComparisonFailure: null expected:<[Mai]n> but was:<[Logo]n> >at junit.framework.Assert.assertEquals(Assert.java:81) >at junit.framework.Assert.assertEquals(Assert.java:87) >at wicket.util.tester.WicketTester.assertRenderedPage( WicketTester.java:760) >at com.genuco.web.pages.order.MainTest.testMain(MainTest.java:37) >at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >at java.lang.reflect.Method.invoke(Unknown Source) >at org.junit.internal.runners.TestMethodRunner.executeMethodBody( TestMethodRunner.java:99) >at org.junit.internal.runners.TestMethodRunner.runUnprotected( TestMethodRunner.java:81) >at org.junit.internal.runners.BeforeAndAfterRunner.runProtected( BeforeAndAfterRunner.java:34) >at org.junit.internal.runners.TestMethodRunner.runMethod( TestMethodRunner.java:75) >at org.junit.internal.runners.TestMethodRunner.run( TestMethodRunner.java:45) >at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod( TestClassMethodsRunner.java:71) >at org.junit.internal.runners.TestClassMethodsRunner.run( TestClassMethodsRunner.java:35) >at org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42) >at org.junit.internal.runners.BeforeAndAfterRunner.runProtected( BeforeAndAfterRunner.java:34) >at org.junit.internal.runners.TestClassRunner.run( TestClassRunner.java:52) >at org.junit.internal.runners.CompositeRunner.run( CompositeRunner.java:29) >at org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42) >at org.junit.internal.runners.BeforeAndAfterRunner.runProtected( BeforeAndAfterRunner.java:34) >at org.junit.internal.runners.TestClassRunner.run( TestClassRunner.java:52) >at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUnit4TestReference.java:38) >at org.eclipse.jdt.internal.junit.runner.TestExecution.run( TestExecution.java:38) >at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests( RemoteTestRunner.java:460) >at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests( RemoteTestRunner.java:673) >at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run( RemoteTestRunner.java:386) >at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196) > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Unit test fail probably cause by authenication
Anyone have any idea? On 12/22/06, Carfield Yim <[EMAIL PROTECTED]> wrote: > The unit test is just create a WebPage and assert it, stacktrace as > below and look like the authenication will forward to Logon page if it > is not authenication . However, in the session I have set it always > return true if it is unit test. Anybody have any idea? > > junit.framework.ComparisonFailure: null expected:<[Mai]n> but was:<[Logo]n> >at junit.framework.Assert.assertEquals(Assert.java:81) >at junit.framework.Assert.assertEquals(Assert.java:87) >at > wicket.util.tester.WicketTester.assertRenderedPage(WicketTester.java:760) >at com.genuco.web.pages.order.MainTest.testMain(MainTest.java:37) >at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >at java.lang.reflect.Method.invoke(Unknown Source) >at > org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) >at > org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) >at > org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) >at > org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) >at > org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) >at > org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71) >at > org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) >at > org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) >at > org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) >at > org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) >at > org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:29) >at > org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) >at > org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) >at > org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) >at > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) >at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) >at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) >at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) >at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) >at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Unit test fail probably cause by authenication
The unit test is just create a WebPage and assert it, stacktrace as below and look like the authenication will forward to Logon page if it is not authenication . However, in the session I have set it always return true if it is unit test. Anybody have any idea? junit.framework.ComparisonFailure: null expected:<[Mai]n> but was:<[Logo]n> at junit.framework.Assert.assertEquals(Assert.java:81) at junit.framework.Assert.assertEquals(Assert.java:87) at wicket.util.tester.WicketTester.assertRenderedPage(WicketTester.java:760) at com.genuco.web.pages.order.MainTest.testMain(MainTest.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71) at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:29) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user