[Wicket-user] WicketTester message resolution
Hi, my application is in the (usual, I think) situation where the messages for the page (i.e.) ContactMePage are partly contained in the ContactMePage.properties file, and partly in the global MyWebApplication.properties file. In this situation, when I use WicketTester to test the ContactMePage I see a lot of INFO log like: WicketMessageResolver - No value found for message key: contact.email because the MockWebApplication cannot resolve messages belonging to the global property file. Is there a way to make WicketTester aware of the existence of global message bundles? (And a more general question) how do you test that all wicket:messages are rendered correctly? Thanks -- Filippo Diotalevi http://www.diotalevi.com http://www.jugmilano.it - 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] WicketTester message resolution
FilippoDiotalevi wrote: > > Hi, > my application is in the (usual, I think) situation where the messages > for the page (i.e.) ContactMePage are partly contained in the > ContactMePage.properties file, and partly in the global > MyWebApplication.properties file. > > In this situation, when I use WicketTester to test the ContactMePage I > see a lot of INFO log like: > > WicketMessageResolver - No value found for message key: contact.email > > because the MockWebApplication cannot resolve messages belonging to > the global property file. > Is there a way to make WicketTester aware of the existence of global > message bundles? > > (And a more general question) how do you test that all wicket:messages > are rendered correctly? > To use application properties I extend WicketTester and have this in constructor: CompoundResourceStreamLocator locator = ( CompoundResourceStreamLocator )getResourceSettings().getResourceStreamLocator(); locator.add( 0, new AbstractResourceStreamLocator() { protected IResourceStream locate( final Class clazz, final String path ) { String testPropertiesFile = MyTester.class.getSimpleName() + ".properties"; String realPropertiesFile = MyApplication.class.getSimpleName() + ".properties"; if( path.contains( testPropertiesFile ) ) { String substitutedPath = path.replace( testPropertiesFile, realPropertiesFile ); return new ClassLoaderResourceStreamLocator().locate( MyApplication.class, substitutedPath ); } return null; } } ); I test wicket:messages simply with WicketTester#assertLabel(...) -- View this message in context: http://www.nabble.com/WicketTester-message-resolution-tf3360811.html#a9349318 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] WicketTester message resolution
On 3/7/07, Dmitry Kandalov <[EMAIL PROTECTED]> wrote: > To use application properties I extend WicketTester and have this in > constructor: > [CUT] Thanks Dmitry I'll give it a try -- Filippo Diotalevi http://www.diotalevi.com http://www.jugmilano.it - 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] WicketTester message resolution
* Dmitry Kandalov: > To use application properties I extend WicketTester and have > this in constructor: Hi Dmitry, Nice code snippet, would you mind opening an issue, and providing your sample code as attachment? Thanks in advance, -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - 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] WicketTester message resolution
Jean-Baptiste Quenot-3 wrote: > > * Dmitry Kandalov: > >> To use application properties I extend WicketTester and have >> this in constructor: > > Hi Dmitry, > > Nice code snippet, would you mind opening an issue, and providing > your sample code as attachment? > Sure, https://issues.apache.org/jira/browse/WICKET-368 Could you please also take a look at https://issues.apache.org/jira/browse/WICKET-258 :) -- View this message in context: http://www.nabble.com/WicketTester-message-resolution-tf3360811.html#a9350442 Sent from the Wicket - User mailing list archive at Nabble.com. - 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] WicketTester message resolution
* Dmitry Kandalov: > > > Jean-Baptiste Quenot-3 wrote: > > > > Nice code snippet, would you mind opening an issue, and providing > > your sample code as attachment? > > Sure, https://issues.apache.org/jira/browse/WICKET-368 Thanks! > Could you please also take a look at > https://issues.apache.org/jira/browse/WICKET-258 :) Yes, it's on my TODO list, I'll do it if no one beats me. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - 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] WicketTester message resolution
You are using 1.2.x? To me it sounds like a bug that WicketTester or MockWebApplication does not look into the application properties file as a normal "Application" does. We should simply look at the config of normal application and copy the one line of config into WicketTester. Juergen On 3/7/07, Jean-Baptiste Quenot <[EMAIL PROTECTED]> wrote: > * Dmitry Kandalov: > > > > > > Jean-Baptiste Quenot-3 wrote: > > > > > > Nice code snippet, would you mind opening an issue, and providing > > > your sample code as attachment? > > > > Sure, https://issues.apache.org/jira/browse/WICKET-368 > > Thanks! > > > Could you please also take a look at > > https://issues.apache.org/jira/browse/WICKET-258 :) > > Yes, it's on my TODO list, I'll do it if no one beats me. > -- > Jean-Baptiste Quenot > aka John Banana Qwerty > http://caraldi.com/jbq/ > > - > 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