Oops. This doesn't work yet because the java HTTP object doesn't seem to send along the Host field on a HTTP GET so c2.com's web server can route the request to the correct virtual server. Bummer.
For now we look around Google instead.
Here is what this page is suppose to look like.
Java gurus suggest that the problem is related to weak libraries in the kaffe implementation and that either sun or ibm jvm will make problems go away.
Testing server side java ...
I wrote this example to help get WilkesJoiner and JimWeaver started with our framework. They didn't seem to need it. While I'm still debuging they are distributing a similar fixture exploiting their jwebunit facade to HttpUnit. Nice work guys. -- WardCunningham
In this example we will use a fixture to look around the web. Developers of web applications often get the idea that this is a good universal interface to their programs. We don't think so. You are far better off testing your server site objects from fixturing running on the server. But you will probably want to do some testing over http so we show here how it can be done.
You can run this test on the fit.c2.com server with the usual run.cgi command. This will have c2.com acting as a client on your behalf.
We use actions to start eg.Page, our web browser like fixture. We can enter location, a web address, or link, which follows a link on the page to a new location. When we enter a link, the fixture searches the current page for an anchor that starts with the entered text. You only have to enter enough to be unique. Then it retrieves that page.
The eg.Page fixture is also a row fixture. Here we use it that way to check on the rows of the SimpleExample.
We left out the pentium bug values on purpose just so you would know we really are reading from that page. We will follow the pentium bug reference just to show that we can read from other servers.
There are a couple of things that are not quite right about this example.
It would be neat to see some tests of an XML interface. Google has one.
|Last edited November 14, 2002
Return to WelcomeVisitors