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: ServletTestRunner misbehaviour
Date Sun, 06 Apr 2003 09:18:06 GMT
Hi Aldrin,

This is already supported in Cactus 1.5. Here's the code:

    private void setSystemProperties(HttpServletRequest theRequest)
    {
        if (this.canSetSystemProperty)
        {
            try
            {
                System.setProperty(
                    BaseConfiguration.CACTUS_CONTEXT_URL_PROPERTY,
                    "http://" + theRequest.getServerName() + ":"
                    + theRequest.getServerPort()
                    + theRequest.getContextPath());
            }
            catch (SecurityException se)
            {
                log("Could not set the Cactus context URL as system
property, "
                    + "you will have to include a Cactus properties file
in "
                    + "the class path of the web application", se);
                this.canSetSystemProperty = false;
            }
        }
    }

WRT JUnit you should report this on the junit mailing list.

Thanks
-Vincent

> -----Original Message-----
> From: Aldrin Leal [mailto:aldrin@leal.eng.br]
> Sent: 06 April 2003 01:20
> To: cactus-user@jakarta.apache.org
> Subject: ServletTestRunner misbehaviour
> 
> Hello,
> 
>     Vincent Massol asked me to post a problem i've had with cactus, in
> order
> to find a solution, the problem affects both JUnit and Cactus'
> ServletTestRunner.
> 
>     They both try to call System.setProperty, causing an exception
under
> some hosting providers. I found this in Brazilian LocaWeb. A solution
> might
> be disabling all the offending code, by re-writing/re-compiling
> BaseTestRunner from JUnit and ServletTestRunner from Cactus.
> 
>     I think an alternative could be read the setup using
> getResourcesAsStream for a given class looking for a .properties file.
For
> a
> simple package, it might be really useful.
> 
>     Well. I just had to report. Cactus is great. It was just a small
> problem
> with my production environment.
> 
>     Thanks in advance, Aldrin Leal, aldrin@leal.eng.br.
> 
> 
> ---------------------------------------------------------------------
> 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