Hi all,

I just discovered a limitation with Cactus when trying to use the cactus ant task while overriding the default contextURL using one of the prescribed methods. It appears that the ant task ignores any such attempt to alter cactus.contextURL unless I set the cactus.contextURL system property in my test class (which I'd rather not do). A quick glance at the CactusTask.java source file and I can see why -- the servername is always set to 'localhost', the port is set to 8080 unless otherwise specified in the port attribute under containerset elements, and the context name is set based on the name of the test war file. This makes sense given that the cactus task starts/stops the servlet container locally, but what if a cactus test case needs to perform a test that examines the value of request.getServerName()? An easy workaround is to define a system property under the cactus task containing the value of cactus.contextURL and then setting cactus.contextURL from begin() in the test class. It's not so bad, but I'm wondering if I missed anything or if someone has a better alternative.

Thanks,
Trevor









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



Reply via email to