You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mats Henricson <ma...@henricson.se> on 2009/09/03 13:47:08 UTC

How do you pass a context to PageTester?

Hi!

Since Testify isn't working for me, I thought I'd look at
this page:

http://tapestry.apache.org/tapestry5.1/guide/unit-testing-pages.html

It has this example:

PageTester tester = new PageTester(appPackage, appName, "...");
Object[] context = new Object[]{ "abc", 123 };
Document doc = tester.invoke(new ComponentInvocation(
                      new PageLinkTarget("MyPage"), context));

Unfortunately I can't find a PageTester.invoke() function
in T5.1. There isn't a ComponentInvocation class either.

So, how IS this supposed to work? And what exactly IS that
context? Is it possible to override the @Injected services
with mock services into my page this way?

Mats

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


Re: How do you pass a context to PageTester?

Posted by Paul Field <pa...@db.com>.
Or you can just create the URL manually with the parameter in your test:
tester.renderPage("mypage/1234");   // 1234 is the id

- Paul


Igor Drobiazko <ig...@gmail.com> wrote on 09/11/2009 06:30:34:
> Just create another page containg a link to target page and click on 
> it. The link can contain a context.

> > Basically, I'm looking to invoke a page
> > and pass it a request parameter. Is this possible?



---

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: How do you pass a context to PageTester?

Posted by Igor Drobiazko <ig...@gmail.com>.
Just create another page containg a link to target page and click on  
it. The link can contain a context.

08.11.2009, в 20:01, mraible <ma...@raibledesigns.com> написал(а):

>
> I'd like to know how to do this too. Basically, I'm looking to  
> invoke a page
> and pass it a request parameter. Is this possible?
>
> Thanks,
>
> Matt
>
>
> Mats Henricson-2 wrote:
>>
>> Hi!
>>
>> Since Testify isn't working for me, I thought I'd look at
>> this page:
>>
>> http://tapestry.apache.org/tapestry5.1/guide/unit-testing-pages.html
>>
>> It has this example:
>>
>> PageTester tester = new PageTester(appPackage, appName, "...");
>> Object[] context = new Object[]{ "abc", 123 };
>> Document doc = tester.invoke(new ComponentInvocation(
>>                      new PageLinkTarget("MyPage"), context));
>>
>> Unfortunately I can't find a PageTester.invoke() function
>> in T5.1. There isn't a ComponentInvocation class either.
>>
>> So, how IS this supposed to work? And what exactly IS that
>> context? Is it possible to override the @Injected services
>> with mock services into my page this way?
>>
>> Mats
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
> -- 
> View this message in context: http://old.nabble.com/How-do-you-pass-a-context-to-PageTester--tp25274401p26256779.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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


Re: How do you pass a context to PageTester?

Posted by mraible <ma...@raibledesigns.com>.
I'd like to know how to do this too. Basically, I'm looking to invoke a page
and pass it a request parameter. Is this possible?

Thanks,

Matt


Mats Henricson-2 wrote:
> 
> Hi!
> 
> Since Testify isn't working for me, I thought I'd look at
> this page:
> 
> http://tapestry.apache.org/tapestry5.1/guide/unit-testing-pages.html
> 
> It has this example:
> 
> PageTester tester = new PageTester(appPackage, appName, "...");
> Object[] context = new Object[]{ "abc", 123 };
> Document doc = tester.invoke(new ComponentInvocation(
>                       new PageLinkTarget("MyPage"), context));
> 
> Unfortunately I can't find a PageTester.invoke() function
> in T5.1. There isn't a ComponentInvocation class either.
> 
> So, how IS this supposed to work? And what exactly IS that
> context? Is it possible to override the @Injected services
> with mock services into my page this way?
> 
> Mats
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-do-you-pass-a-context-to-PageTester--tp25274401p26256779.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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