Dealing with 'external' resources and Global configuration
Tim Diggins <[email protected]>
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all - Looking for comments or reactions for the following topic, describing a current failing and a possible way forward (2.0+) == Dealing with 'external' resources and Global configuration == Background (please correct me if this is wrong): httpunit effectively consists of a pseudoclient and a pseudoserver - which itself can be act as a servlet container (like Tomcat/Jetty) At present external (outside the pseudoserver) resources cannot be fetched by the pseudoclient in http-unit. At present resources that are external (e.g. <script href="http://adsense.google.com/ blahblahblah" /> ) httpunit just tries to fetch the same path (/ blahblahblah) from the pseudoserver - which fails, with an error (providing the resource is automatically retrieved, as for scriptable objects. Wolfgang was proposing (if I got it right...) that it would be good if there was a way to configure httpunit GLOBALLY, rather than just programmatically per test. There would be sensible defaults if there was no configuration, or if the config option was missing. In the case of external resources, the default configuration would be that external resources are treated as warnings - any external resource found would trigger some kind of warning (printout to stderr?) but wouldn't cause a failure If you wanted you could then make external resources: always fail... always be ignored... stay as default (warning) ... or be fetched from the external resource. And then even more usefully, you could optionally configure this on a per-url basis (maybe like log4j's conf file handles per package logging options) - so that for example you skip downloading things from google.com (ignore) but fetch things from your own assets server... (These are some rough notes from a discussion with Wolfgang - there will be another separate email on different aspects to keep the thread discussions readable.) Thoughts/ comments? kind regards Tim Tim Diggins http://red56.co.uk/people/tim [email protected] tel +44 (0)7515 931 642 ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace