jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@pivolis.com>
Subject RE: Conventions for "configuring" TestCase classes?
Date Tue, 18 Mar 2003 07:46:45 GMT
Hi David,

Why don't you use a ResourceBundle?

public void beginXXX()
{
    PropertyResourceBundle bundle = ResourceBundle.getBundle("myprops");
    bundle.getString("someproperty");
[...]

Alternatively, if you're using a script to run the test, you can pass
the properties as system properties, using the -D switch. For example
with Ant:

        <junit printsummary="yes" haltonfailure="yes" fork="yes">
            <jvmarg value="-Dsome.thing=some.value"/>
[...]

Note that Cactus 1.5 offers a one time initialization mechanism
(begin()) which you can use to initialize values.

Hope it helps,
-Vincent

> -----Original Message-----
> From: David M. Karr [mailto:dmkarr@earthlink.net]
> Sent: 18 March 2003 03:45
> To: cactus-user@jakarta.apache.org
> Subject: Conventions for "configuring" TestCase classes?
> 
> I have some configuration parameters I'd like to set for my TestCases.
> I'd
> prefer not to hardcode them in the class.  I can't just use the
"web.xml"
> and
> set servlet init parameters because I need these parameters to be
readable
> on
> the client side of the TestCase.
> 
> What do people normally do in this situation?
> 
> --
> ===================================================================
> David M. Karr          ; Java/J2EE/XML/Unix/C++
> dmkarr@earthlink.net   ; SCJP; SCWCD
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org



Mime
View raw message