From: Brad C. <bc...@bo...> - 2004-01-09 21:40:31
|
I mentioned this on the list a while back but now I've actually got the code for it. THIS IS NOT A RELEASE! This is just something so people can take a look and give some feedback. You are not (yet) permitted to use this for anything other than giving me feedback :) http://yourgod.sourceforge.net/Framework.zip It's sort of large because it contains all the required jars as well as a final compiled jar of itself. Eclipse project files are included as well as an ant build.xml. The included htmlunit.jar is a recent CVS compile, not a released version, so dropping this into an existing project may cause a problem or two. I could make this a separate project (much like jwebunit is separate from httpunit) or it could become part of htmlunit. I believe everything it relies on is Apache licensed so this will likely follow the same license if it is released separately. Nearly everything is completely unit tested, so if you need to know how something works just look at the tests. Some notes on what's going on: * The Habitat sort of manages your testing process by owning the WebBrowser and Service objects. * Habitat and Service are intended to be extended for your particular project. * WTFTestCase is mostly just a convenience, though I do have similar TestCase extensions for our other projects. Using WTFTestCase is not required. * The GuiMap is an object representation of your web application in the simplest terms possible (the Widget). Nobody I have spoken to likes the GuiMap. Nobody I have spoken to has a better idea. I eagerly await any suggestions on improving this part of the framework. * The WebBrowser uses htmlunit (mostly indirectly) to figure out which page from the GuiMap is currently "displayed" and generate a WebPage for you to use. It also keeps history and does other "web browserly" things. * WebPage objects are your way of interacting with htmlunit. If I can't do what I want with WebPage I tend to question if I should be doing it at all :) * 90% of the interaction with htmlunit is confined to the WebAdapter. While there are a few instances of exposing/using WebClient outside of WebAdapter I would very much like to remove these as soon as I can find alternatives (though having access to WebClient does make this usable if you occasionally need something the framework doesn't provide...) Brad C |