Re: Setting url to launch after build
Re: Setting url to launch after build
- Subject: Re: Setting url to launch after build
- From: Colin Clark <email@hidden>
- Date: Mon, 5 Jul 2004 11:44:34 -0400
Hi Thomas,
My mistake. The suggested code I sent you was off the top of my head.
What you're seeing with performActionNamed() is the correct behavior.
All direct action methods must be named "<some>Action()" in order to be
correctly invoked by the direct action request handler. Overriding
performActionNamed() is overkill and still would not have made this
code work.
The problem is that performActionNamed() only performs the specified
action on the WODirectAction subclass you call it on. In this case,
you're calling it within your own DirectAction class. WOUnitTest
provides two other direct action classes, "ut" and "uta," for its own
direct actions.
As a much simpler approach, there is a WOUnitTest component that
actually handles running tests called WOUTMain. If you invoke that
directly in your defaultAction() method, you'll get the test runner
component when your application starts up. This code will do the trick:
public WOActionResults defaultAction() {
return pageWithName("WOUTMain");
}
Colin
On Friday, July 2, 2004, at 01:15 PM, Thomas Lewis wrote:
This seems to work partly... The problem is that "Action" is added to
any action passed to performActionNamed(). Since WOUnitTest's action
is uta and not utaAction this won't work. If I could find out how to
override performActionNamed() this will work.
On Jul 1, 2004, at 6:09 PM, Colin Clark wrote:
Hi Thomas,
To load the WOUnitTest runner page by default when the application
starts up, you'll need to do two things:
1. Change the application's default request handler to the
DirectAction request handler. One possible place to do this in your
Application's constructor:
WORequestHandler daHandler =
requestHandlerForKey(directActionRequestHandlerKey());
setDefaultRequestHandler(daHandler);
2. Next, you'll want to ensure that your default direct action
returns the WOUnitTest runner action. This should be put into your
DirectAction.defaultAction() method. The "uta" action is the
WOUnitTest DA for accessing the "all tests" runner.
return performActionNamed("uta");
That's it. Obviously, you'll want to make sure you take this code out
before deployment so your users don't automatically see the unit test
runner page.
Realistically, you probably won't want to link to the WOUnitTest
framework at all when you're building your application for
deployment, since it isn't a great idea to leave in an action in that
can allow users to run your unit tests on a deployed application!
I hope that helps,
Colin
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
---
Colin Clark
Dynamic Web and Database Development Lead,
Resource Centre for Academic Technology,
University of Toronto
(416) 946-7592 / email@hidden
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.