ServletTestRunner should build test redirector URL from incoming request, not 
use CACTUS_CONTEXT_URL_PROPERTY unless instructed
-------------------------------------------------------------------------------------------------------------------------------

                 Key: CACTUS-256
                 URL: https://issues.apache.org/jira/browse/CACTUS-256
             Project: Cactus
          Issue Type: Improvement
          Components: Framework
    Affects Versions: 1.8, 1.7.2
            Reporter: Keith D Gregory


The first time ServletTestRunner gets invoked, it builds the context URL for 
the actual test requests, and saves it in the system property 
"cactus.contextURL" (BaseConfiguration.CACTUS_CONTEXT_URL_PROPERTY). All 
subsequent requests then use that property value, ignoring the actual request 
URL. This is bad on several levels.

First, because it's impolite to set system-wide properties in a shared 
execution environment. 

Second, and more important, because it prevents running tests in an environment 
that uses virtual homes and extracts information from the request URL. If you 
want to have particular behavior for requests to "foo.example.com", and have 
already run tests for "bar.example.com", you have to restart your container. Or 
spend a couple hours with a debugger and the Cactus source code, trying to 
figure out why your tests are failing (no, I'm not bitter :-)).

And third (just throwing this in for good measure), because it breaks the JUnit 
premise that tests execute in isolation, and are not dependent on execution 
order.

Personally, I can't see a reason for caching this value. It's not terribly 
expensive to create it anew for each run. For those people who do want to have 
their first test influence all subsequent tests, it could be a request 
parameter ("rememberThisHost=yes").

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to