Testify question about @Parameter

View: New views
4 Messages — Rating Filter:   Alert me  

Testify question about @Parameter

by Mats Henricson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I never understand how to "inject" mock members annotated
with @Parameter into a page when testing with Testify.

Anyone knows how to do that?


Mats

PS. Oh, what about @Environmental members? Same question.

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


Re: Testify question about @Parameter

by Paul Field-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I never understand how to "inject" mock members annotated
> with @Parameter into a page when testing with Testify.

I'm not sure I understand the question. I thought @Parameter only made
sense for components - not pages.


> PS. Oh, what about @Environmental members? Same question.

I haven't tried this for testing but, to get things to be available
through @Environment, you get hold of (inject or lookup) the "Environment"
service and use the push() and pop() methods. Have a look at this
documentation:
http://tapestry.apache.org/tapestry5/guide/env.html

- Paul







---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.

Re: Testify question about @Parameter

by Thiago H. de Paula Figueiredo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Em Thu, 29 Oct 2009 15:45:36 -0200, Paul Field <paul.field@...>  
escreveu:

>> I never understand how to "inject" mock members annotated
>> with @Parameter into a page when testing with Testify.
>
> I'm not sure I understand the question. I thought @Parameter only made
> sense for components - not pages.

That's exactly one of the few differences between components and pages in  
Tapestry 5: components have parameters, pages don't.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: Testify question about @Parameter

by Mats Henricson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>>> I never understand how to "inject" mock members annotated
>>> with @Parameter into a page when testing with Testify.
>>
>> I'm not sure I understand the question. I thought @Parameter only made
>> sense for components - not pages.
>
> That's exactly one of the few differences between components and pages
> in Tapestry 5: components have parameters, pages don't.

Yes, you are exactly right, this question was a thinko from
my side. Thanks for your support!

Mats



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