Re: Variant Change Behavior

2014-09-09 Thread Martin Grigorov
Please check that the solution provided with https://issues.apache.org/jira/browse/WICKET-5694 will do the job. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Sep 8, 2014 at 10:45 AM, Thibault Kruse tibokr...@googlemail.com wrote: Hm, thinking some more,

Re: Variant Change Behavior

2014-09-09 Thread Martin Grigorov
https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commit;h=702bf45a Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Sep 9, 2014 at 10:42 AM, Martin Grigorov mgrigo...@apache.org wrote: Please check that the solution provided with

Re: Variant Change Behavior

2014-09-09 Thread Thibault Kruse
The API looks good. I don't have time to test it right now. On Tue, Sep 9, 2014 at 9:44 AM, Martin Grigorov mgrigo...@apache.org wrote: https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commit;h=702bf45a Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On

Re: Variant Change Behavior

2014-09-08 Thread Martin Grigorov
Hi, There is nothing specific for this. But you can use various org.apache.wicket.util.tester.WicketTester#executeTest() methods to check the response against a valid response pre-saved in a file. Or you can use org.apache.wicket.util.tester.WicketTester#assertContains() to check that a specific

Re: Variant Change Behavior

2014-09-08 Thread Thibault Kruse
Both solutions are not ideal, since we do not want our tests to become brittle. We want to functionally test components in multiple variants, but where the variants vary in mere layout (css classes), we do not want to have tests break just because the layout changes (as long as the component still

Re: Variant Change Behavior

2014-09-08 Thread Thibault Kruse
Hm, thinking some more, the general solution would be to fail if a variant is requested, and it is among a set of whitelisted variants, and the markup is not found. For other variants, using the default would probably be fine. This is more general than our current usecase, but still significant I

Re: Variant Change Behavior

2014-09-05 Thread Thibault Kruse
Thanks Martin, that works for us. I missed that Variants are inherited from parents. Is there also a good way that I can assure in our unit tests that the variant markup for certain components exists and was found? Else a typo would go unnoticed in the unit tests. cheers, Thibault On Wed,

Re: Variant Change Behavior

2014-09-03 Thread Martin Grigorov
Hi, The behaviors are not used for variations. For such use cases you should override org.apache.wicket.Component#getVariation() on the (base) page. This way all components will know the correct variation. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed,