Justin Deoliveira wrote:
Hi Magne,
Writing some http tests would be great and is greatly encouraged. I
myself am going to try and get into the habit of writing a test case
anytime a bug shows up. This will be an effective way to make sure that
it never crops up again.
Hi
This has always been my preferred approach, but it is hard to keep up.
I do recognise the advantages with automatic testing, but it takes time
to create good tests. In a stressful environment that a developer lives
in, time limes and delivery dates, it is hard to keep up testing.
In a open source project like this however, I see no excuse for not
testing. Surely there should be some pressure on delivery, but not on
the expense of system reliability.
It would also be possible to use ServletUnit
(http://httpunit.sourceforge.net/doc/servletunit-intro.html) to emulate
the application server. I have not read to much about it yet, but if we
had a proper set-up http unit tests could be executed without any server
running. Sounds neat, but maybe to much work? Will certainly look into
it though.
I have written some tests and the result baffles me a bit:
[junit] Testcase: testImage took 0,578 sec
[junit] Testcase: testImagePost took 0,156 sec
The two tests is the exact same. The first is GET and the second is
POST. The result is almost the same each time, but post use almost just
1/3 of the time of get.
I do wonder where the time delta between them come from.
Is it the test set-up, overhead in the http protocol, tomcat parsing the
query string to get the parameters?
I would like to implement POST handling directly in each of the
servlets, and make the TestWfsPost servlet redundant, but not unusable.
A good place to start would be to write the tests for this, making sure
I don't break stuff.
I am not sure how the sample request is populated on the page, but it
would be a good feature to implement all of them in a httpunit test, so
that I/we don't break stuff again.
Next to the ant build file cleanup that I volunteered for, it seems like
that I have my work cut out for me. That is of course if you guys agree
with the work I have outlined.
It is certainly great working on a project, driven only by the
excitement of creating a component a lot of people all around the world
can make use of.
Magne
Magne Skjeret wrote:
Justin Deoliveira wrote:
Hi all,
Hi
Excellent work. I have started to do some post vs. get testing for the
GetMap requests.
I have some questions in that regard:
1. For a test setup is there a map that I can use that I know will be
there? Like states. Or would I have to upload a map in my test suite?
In the docs I wrote, I recommend that everyone write tests against the
UserBasic cite configuration. I thought this is easiest way to ensure
that everyone can run the http unit tests. However I am sure that this
configuration might not have the necessary data for a particular test.
I am open to ways to go about this. We could create a new configuration
that is soley for testing, but I think that is what UserBasic already
is. The easiest thing is probably just to add data to it when needed fo
r a test.
2. I also find it a bit odd that the httptest.properties is commited to
subversion. Each of the developers could have their own setup, e.g.
different port number. Since it is in the code repository, someone are
in danger of committing it making the life of others harder.
The default paramters assume the following defaults:
- http protocol
- 8080 port
- localhost
- geoserver context
Which i think is what alot of devlopers do. My intention is to have the
httptest.properties be handled like build.properties which has custom
paramters in it. In other words, noone should ever commit their
httptest.properties file.
However I am open to other ways to do this. Anyone else have any ideas?
My suggestion would be to e.g. add a httptest.properties.example file,
and document that testers must copy that file into httptest.properties
using their own setup parameters.
Magne
I have spent some time playing with HttpUnit
(http://httpunit.sourceforge.net/) and found it to be a very effective
means of testing.
Unit tests only get us so far (we dont have many) as they test things in
isolation. Http unit tests are much like CITE tests in that they are a
good tool for integration testing.
I added the httpunit library to the codebase. There are also some
example tests under the httptest directory. I wanted to seperate them
from the normal unit tests since they require a running instance of
geoserver.
I also wrote some docs on how to execute the tests.
http://docs.codehaus.org/display/GEOSDOC/Project+Conventions
Under Testing.
Please check them out and make any comments/corrections.
Thanks.
Justin
p.s. If someone was really keen they could write an http unit test which
would churn through all the files in the demo directory.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel