Re: Testify question about @Parameter

2009-11-04 Thread Mats Henricson
>>> 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 component

Testify question about @Parameter

2009-10-29 Thread Mats Henricson
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

Testify and activation context problems

2009-10-26 Thread Mats Henricson
Hi! I use Testify to smoke test our pages, and currently I have problems with a non-empty onActivate() function: public Object onActivate(Long id) { // ... } What do I need to mock to get this onActivate() function to be called? Mats

Testify problem: TapestryTest not in base package

2009-10-21 Thread Mats Henricson
Hi! I'm trying to create a simple smoke test of all pages, like this: @Test public void testRenderPages() { Collection pages = classNameLocator.locateClassNames(PAGES_PACKAGE); tellMockitoHowToMock(); for (String page : pages) { String pagePath = getPagePath(page);

Re: DDOS emergency button for Tapestry 5?

2009-10-14 Thread Mats Henricson
>> Hi! > > Hi! Hi! You Tapestry guys are slow today. It took a whopping 8 minutes to get an answer... ;-) >> So, what would you guys do? Is there a simpler solution? A filter? > > I would use a ResquestFilter or a Dispatcher checking some service (that > would hold the underDDoS field) and red

Re: DDOS emergency button for Tapestry 5?

2009-10-14 Thread Mats Henricson
t to interact? A Tapestry page or a simple >> HTML page (which I think should be better when are under a DDOS attack) ?You >> have a lot of places where you can interact, depending on the previous >> question :-) >> >> >> On Wed, Oct 14, 2009 at 2:08 PM, Mats Henri

DDOS emergency button for Tapestry 5?

2009-10-14 Thread Mats Henricson
Hi! I'm working on a Tapestry 5.1 site that frequently gets hammered by DDOS attacks. We recently talked about it in our team, and one idea I'm currently investigating is to have a flag in our system that I can turn on dynamically that would require all users to be logged in. So, real users would

Mapping org.acegisecurity.AccountExpiredException

2009-09-15 Thread Mats Henricson
Hi! I need to map three Acegi exceptions to specific pages: org.acegisecurity.AccountExpiredException org.acegisecurity.CredentialsExpiredException org.acegisecurity.LockedException I can't see how to do it in contributeApplicationDefaults(), since there doesn't appear to be configurati

Re: Testify and asset/context?

2009-09-10 Thread Mats Henricson
Paul Field wrote: > Mats Henricson wrote on 10/09/2009 14:59:32: >> How should we make Testify aware of asset and context? >> For example, we have this in our TML: >>${context:/foo/bar/} >> Currently testify barfs at us like this: >> >> Caused by: java.

Testify and asset/context?

2009-09-10 Thread Mats Henricson
Hi! How should we make Testify aware of asset and context? For example, we have this in our TML: ${context:/foo/bar/} Currently testify barfs at us like this: Caused by: java.lang.RuntimeException: Unable to locate asset 'context:foo/bar' (the file does not exist). at org.apache.t

Re: Problem with testify and @SessionState injection

2009-09-08 Thread Mats Henricson
Paul Field wrote: > Mats Henricson wrote on 08/09/2009 09:41:56: >> Mats Henricson wrote: >>> So, how should I inject my mocked @SessionState object? Is it >>> possible through the tester object, before I render the page? >> I'm te

Re: Problem with testify and @SessionState injection

2009-09-08 Thread Mats Henricson
Mats Henricson wrote: > Paul Field wrote: >> Mats Henricson wrote on 07/09/2009 12:48:39: >> >>> I am really close to get my Testify machinery working for >>> my first non-trivial page. The last hurdle (touch on wood) >>> is that the @ForComponents annot

Re: Problem with testify and @SessionState injection

2009-09-07 Thread Mats Henricson
Paul Field wrote: > Mats Henricson wrote on 07/09/2009 12:48:39: > >> I am really close to get my Testify machinery working for >> my first non-trivial page. The last hurdle (touch on wood) >> is that the @ForComponents annotation doesn't inject my >> m

Problem with testify and @SessionState injection

2009-09-07 Thread Mats Henricson
Hi! I am really close to get my Testify machinery working for my first non-trivial page. The last hurdle (touch on wood) is that the @ForComponents annotation doesn't inject my mock object in fields annotated with @SessionState. I can't see any example doing this, so, does it work? Am I on the wr

Testify NullPointerException?

2009-09-04 Thread Mats Henricson
Hi! I'm getting pretty close now. I've managed to get to the renderPage() function, where I get a NPE: Caused by: java.lang.NullPointerException at org.apache.tapestry5.internal.renderers.RequestRenderer.render(RequestRenderer.java:48) What happens on that line is: String contextPat

Re: Can't get Testify & JUnit 4 & Mockito working

2009-09-04 Thread Mats Henricson
ublic boolean service(Request request, Response response, >>> RequestHandler handler) throws IOException { >>> requestGlobals.storeServletRequestResponse(mock >>> (HttpServletRequest.class), mock(HttpServletResponse.class)); >>> re

Re: Can't get Testify & JUnit 4 & Mockito working

2009-09-04 Thread Mats Henricson
ndler.service(request, response); >> } >> }; >> config.add("EnsureNonNullHttpRequestAndResponse", filter, >> "before:*"); >> } >> >> Kind regards, >> Peter >> >> >> - Ori

Re: Can't get Testify & JUnit 4 & Mockito working

2009-09-04 Thread Mats Henricson
uest.class), mock(HttpServletResponse.class)); > return handler.service(request, response); > } > }; > config.add("EnsureNonNullHttpRequestAndResponse", filter, > "before:*"); > } > > Kind regards, > Peter > &

Re: Can't get Testify & JUnit 4 & Mockito working

2009-09-03 Thread Mats Henricson
>> My current guess is that @ForComponents is pulling in and handling >> binding from my real AppManager, even though it is in no way part >> of the test. > > In that case try creating the TapestryTester with a nonsense app name: > >private static final TapestryTester SHARED_TESTER >=

How do you pass a context to PageTester?

2009-09-03 Thread Mats Henricson
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

Re: Can't get Testify & JUnit 4 & Mockito working

2009-09-03 Thread Mats Henricson
>>> Caused by: java.lang.RuntimeException: Service id 'xyzConfig' is >>> not defined by any module. Defined services: AccessDecisionManager, >>> ... VirtualAssetStreamer. >> Something is trying to look up a service with id "xyzConfig" - using that >> id. I assume you have something like this in y

Re: Can't get Testify & JUnit 4 & Mockito working

2009-09-03 Thread Mats Henricson
> Hi Mats, Hi! >> I then have a subclass with the JUnit 4 test: >> >> public class GamesLauncherTest extends AbstractPageTest { >> >> @ForComponents @Mock >> private XyzManager xyzManager; >> >> @Mock >> private XyzConfig xyzConfig; >> >> >> What I get is runtime exceptions, such

Can't get Testify & JUnit 4 & Mockito working

2009-09-02 Thread Mats Henricson
Hi! I've spent some time now trying to get Testify working. I do it according to the documentation, with an abstract base class like this: public abstract class AbstractPageTest extends TapestryTest { private static final String APP_PACKAGE = "com.expekt.web"; private static final Tapest

DISabling the back button

2006-11-29 Thread Mats Henricson
This may be elementary, but we have two cases where we don't want our users to be able to use the browsers back button: 1. After a submit of a form, when we've sent them to a new page saying "Your blah blah blah has been submitted successfully". Allowing users to go back and submitting again,

Re: How can I do custom Exception page in tapestry portlet?

2006-10-20 Thread Mats Henricson
t;New" as the prefix to the page names? Can I call them whatever I want? * Do the backing Java classes implement any special interfaces? * Do I need to do anything in hivemodule.xml ? Sorry for these idiotic questions, but it doesn't work as is. Mats On 10/20/06, Andreas Andreou

Re: How can I do custom Exception page in tapestry portlet?

2006-10-20 Thread Mats Henricson
Hi! I think that page describes how to do it in Tapestry 3. I use this in 4, and it works: GeneralError is my page, and it has a corresponding Java, HTML and page class. Unfortunately you can't handle stale sessions the same way. I've struggled with that for about two days now. The info I

How do I override the stale session and links pages

2006-10-19 Thread Mats Henricson
Hi! I've spent too much time trying to figure out how this is done in Tapestry 4. I found this suggestion on the net: The exception page works fine, but the stale session/link does not. Does the accompanying Java page file need to extend a specific base? I need n