views:

354

answers:

1

Hi,

I need to do an integration tests on my web application on each build.

Currently I have a set of JUnit tests, which tests various parts of an application before it constructed into war. What I need to do now is to test if application is in good shape after it is deployed into Web container.

The application is written using Spring framework, I've read a lot of docs about Spring integration testing, but all they talk is about testing of integration with databases etc. I've read about Cactus, but the info is pretty scarse as well.

Any pointers for a good tutorials and source code are appreciated.

Details of a software used by app: Spring 2.5, Hibernate 3.2, Maven 2.2, Tomcat 6.0

Many thanks!

+1  A: 

You have two tasks to solve: A) Get the container running in an automated (maven based) process and B) run some tests against it.

We use selenium and maven-jetty-plugin for testing a fairly similar application setup. Works like a charm. You might find the same kind of plugins for tomcat, or just run in jetty.

The advantage of selenium is that it allows you to test the application in a very real environment with a real browser. You may find that tools that skip the "real browser" part are simpler to start with.

krosenvold
My goal here is not to test real functionality of an application (that's the job for tester, who has specific tools to do that), but to verify that application works when it is deployed to a server, aka integration testing. How do you run your tests, though? Are they selenium specific or junit ones?
LeChat
It's a junit test, run through maven in an automated fashion. I'm not sure the distinction between the different kinds of testing is all that important.
krosenvold
So you can typically make a configuration that accepts the target environment to test as a parameter.
krosenvold
I know what needs to be executed, that's not a problem. I struggle with the source code for the tests. How, for example, I would execute my login page jsp in order to see if it doesn't fail to connect to database or is it there at all.
LeChat