views:

53

answers:

3

What is the "best" (or a good way) to unittest java web applications, that is not using an existing framework such as struts, stripes or spring? Is using tools like httpunit or htmlunit good? Which is the best if so?

Would really appreciate an answer since I will depend on it in this project, so finding out that my choice sucked half-way in wouldn't be fun :)

The test framework should hopefully be relatively simple and easy to use as well :)

+2  A: 

I would prefer using selenium rather than httpunit or htmlunit because you can test it as if you are testing from a browser. You can also integrate it with Java if you want.

jpartogi
A: 

For unit-testing, I suggest JUnit. Even if you're not using a dependency-injection framework, you can still do proper unit-testing. For automated function tests, I agree with jpartogi; selenium is the way to go.

Buhb
+1  A: 

A good general methodology is to try to separate the application logic from the presentation as much as possible. If you do this right you can unit test large parts of the application with standard unit tests. For the last part I also recommend writing some all-covering tests using selenium. Don't overdo it though, it is easy to paint yourself into a corner with too much view testing.

disown