You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Vit Rozkovec <vi...@gmail.com> on 2017/05/06 12:37:05 UTC

WicketTester's possible bug?

Hi,

when testing the application which is in deployment mode, test passes 
even when the child is missing:

Code:

         TextField<String> input = new TextField<String>("input");
         add(new WebMarkupContainer("border").add(input));

HTML:

         <div wicket:id="border">
         </div>

Test:

         //start and render the test page
         tester.startPage(HomePage.class);

         //assert rendered page class
         tester.assertRenderedPage(HomePage.class);


In development mode, this test fails, in deployment passes. Is it 
desirable effect or a bug?

I've used Wicket 8.0.0-M5 quickstart which shows this behavior that I 
can provide.

Thanks,
Vit


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: WicketTester's possible bug?

Posted by Vit Rozkovec <ro...@email.cz>.
I see now, thanks a lot.
Vit

On 05/07/2017 03:41 PM, Martin Grigorov wrote:
> The setting is DebugSettings#componentUseCheck:
> https://github.com/apache/wicket/blob/e22614277685199ed56c3aa855fdb0daf454027e/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java#L137
> The rendering is markup driven, i.e. for every component in the HTML Wicket
> tries to find a component in Java. So technically the extra child in Java
> is not really a problem.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Sat, May 6, 2017 at 8:31 PM, Martijn Dashorst <martijn.dashorst@gmail.com
>> wrote:
>> This is as designed. We are stricter in our markup checking in dev
>> mode than in prod mode. Mostly because of performance considerations.
>> You can fiddle with the settings to make dev and prod similar.
>>
>> Search the archives or see the one of the *Settings classes for which
>> setting to en/disable. (I don't know it by name)
>>
>> Martijn
>>
>>
>> On Sat, May 6, 2017 at 2:37 PM, Vit Rozkovec <vi...@gmail.com>
>> wrote:
>>> Hi,
>>>
>>> when testing the application which is in deployment mode, test passes
>> even
>>> when the child is missing:
>>>
>>> Code:
>>>
>>>          TextField<String> input = new TextField<String>("input");
>>>          add(new WebMarkupContainer("border").add(input));
>>>
>>> HTML:
>>>
>>>          <div wicket:id="border">
>>>          </div>
>>>
>>> Test:
>>>
>>>          //start and render the test page
>>>          tester.startPage(HomePage.class);
>>>
>>>          //assert rendered page class
>>>          tester.assertRenderedPage(HomePage.class);
>>>
>>>
>>> In development mode, this test fails, in deployment passes. Is it
>> desirable
>>> effect or a bug?
>>>
>>> I've used Wicket 8.0.0-M5 quickstart which shows this behavior that I can
>>> provide.
>>>
>>> Thanks,
>>> Vit
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>> --
>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: WicketTester's possible bug?

Posted by Martin Grigorov <mg...@apache.org>.
The setting is DebugSettings#componentUseCheck:
https://github.com/apache/wicket/blob/e22614277685199ed56c3aa855fdb0daf454027e/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java#L137
The rendering is markup driven, i.e. for every component in the HTML Wicket
tries to find a component in Java. So technically the extra child in Java
is not really a problem.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sat, May 6, 2017 at 8:31 PM, Martijn Dashorst <martijn.dashorst@gmail.com
> wrote:

> This is as designed. We are stricter in our markup checking in dev
> mode than in prod mode. Mostly because of performance considerations.
> You can fiddle with the settings to make dev and prod similar.
>
> Search the archives or see the one of the *Settings classes for which
> setting to en/disable. (I don't know it by name)
>
> Martijn
>
>
> On Sat, May 6, 2017 at 2:37 PM, Vit Rozkovec <vi...@gmail.com>
> wrote:
> > Hi,
> >
> > when testing the application which is in deployment mode, test passes
> even
> > when the child is missing:
> >
> > Code:
> >
> >         TextField<String> input = new TextField<String>("input");
> >         add(new WebMarkupContainer("border").add(input));
> >
> > HTML:
> >
> >         <div wicket:id="border">
> >         </div>
> >
> > Test:
> >
> >         //start and render the test page
> >         tester.startPage(HomePage.class);
> >
> >         //assert rendered page class
> >         tester.assertRenderedPage(HomePage.class);
> >
> >
> > In development mode, this test fails, in deployment passes. Is it
> desirable
> > effect or a bug?
> >
> > I've used Wicket 8.0.0-M5 quickstart which shows this behavior that I can
> > provide.
> >
> > Thanks,
> > Vit
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: WicketTester's possible bug?

Posted by Martijn Dashorst <ma...@gmail.com>.
This is as designed. We are stricter in our markup checking in dev
mode than in prod mode. Mostly because of performance considerations.
You can fiddle with the settings to make dev and prod similar.

Search the archives or see the one of the *Settings classes for which
setting to en/disable. (I don't know it by name)

Martijn


On Sat, May 6, 2017 at 2:37 PM, Vit Rozkovec <vi...@gmail.com> wrote:
> Hi,
>
> when testing the application which is in deployment mode, test passes even
> when the child is missing:
>
> Code:
>
>         TextField<String> input = new TextField<String>("input");
>         add(new WebMarkupContainer("border").add(input));
>
> HTML:
>
>         <div wicket:id="border">
>         </div>
>
> Test:
>
>         //start and render the test page
>         tester.startPage(HomePage.class);
>
>         //assert rendered page class
>         tester.assertRenderedPage(HomePage.class);
>
>
> In development mode, this test fails, in deployment passes. Is it desirable
> effect or a bug?
>
> I've used Wicket 8.0.0-M5 quickstart which shows this behavior that I can
> provide.
>
> Thanks,
> Vit
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org