Hi

In the end I used the following to get the Resource value.

tester().getApplication().getResourceSettings().getStringResourceLoaders().get(5).loadStringResource(HeaderPanel.class,
"resource-keyl",Locale.getDefault(), tester().getSession().getStyle(), "")

Is there an easier way to get the resource?

Thanks

On 9 September 2016 at 22:44, David Beer <david.m.b...@gmail.com> wrote:

> Hi Martin
>
> I use a custom Wicket Application added to WicketTester via new
> WicketTester(new WicketApplication()). I use a similar process to the way
> wicket-bootstrap-core creates the Tester class and Wicket Application.
>
> Thanks
>
> David
>
>
> On 5 September 2016 at 21:02, Martin Grigorov <mgrigo...@apache.org>
> wrote:
>
>> Hi David,
>>
>> The answer is YES.
>> But I'll need more information about your current setup to be able to
>> suggest how to fix it.
>>
>> I guess your resources are in YourApplication.properties but your tests
>> use
>> MockApplication.
>> If this is the case then you have two options:
>> 1) new WicketTester(new YourApplication())
>> 2)
>> tester.getApplication().getResourceSettings().getStringResou
>> rceLoaders().add(new
>> ClassStringResourceLoader(YourApplication.class))  (I don't have my IDE
>> in
>> front of me right now, so the names could be slightly wrong).
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Sat, Sep 3, 2016 at 3:53 PM, David Beer <david.m.b...@gmail.com>
>> wrote:
>>
>> > Hi All
>> >
>> > I am new to WicketTester and am trying to test the content on my panel
>> via
>> > the page. My question is more around the fact that the panel requests
>> its
>> > content from a resource file via ResourceModel, is there a way I can use
>> > the same resource file in my tests?
>> >
>> > Thanks
>> >
>> > David
>> >
>>
>
>

Reply via email to