You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryce Fischer <br...@berzerker-soft.com> on 2004/01/05 03:48:26 UTC

MockObjects and Struts

I'm trying to setup an environment to test my Action classes. To do this,
I'd like to be able to use MockObjects as my delegate classes. 

A test Login action, for example, may have an interface SecurityManager,
with a single method boolean validateLogin(String username, String
password)

I'd like to be able to somehow pass a MockObject implementation of my
interface to my Action class to test various things. I'm not sure how to
do this. Any suggestions?

Something things I've thought of: 

1. Have field declaration set to default delegate class. Have getter
method to change.

2. Insert class as Session variable. I can do this fairly easy in my
Test cases, but not sure how I'd do this in deployed situation...

TIA.

-- 
Bryce Fischer <br...@berzerker-soft.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org