You can provide a single package-private setter for all properties which you
can use in tests.

@Property
private Foo foo;

@Property
private Bar bar;

@Property
private Baz baz;

void inject(Foo foo, Bar bar, Baz baz){ ... }

If you test your pages with PageTester, you often don't need any setters
because the page is rendered as in production.
http://tapestry.apache.org/tapestry5/guide/unit-testing-pages.html

On Sat, Feb 14, 2009 at 12:24 AM, manuel aldana <ald...@gmx.de> wrote:

> Tapestry goes for pojos which is good for testing. Further more I like the
> @Property annotation which doesn't pollute my class with verbose
> getters/setters.
>
> The not so nice thing is, that when trying to test my component or page I
> again end up having getters/setters. I place my tests inside the same
> package as the class to be tested and private fields aren't visible there.
>
> Why was the decision taken that fields must be private for @Property
> (security reasons, so fields can't be changed directly from default
> visibility -> package level)? From testing perspective this is not so nice.
>
> --
> manuel aldana
> ald...@gmx.de
> software-engineering blog: http://www.aldana-online.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko

Reply via email to