views:

182

answers:

3

I am looking for an open source Java project containing two reasonably complete test suites: a suite of integration tests and a suite of unit tests, for the same code.

Note that I am only interested in developer tests, written with JUnit or TestNG.

I ask this because I often see people saying that having both unit and integration tests is necessary. But so far I don't know of any codebase with both kinds of test coverage.

Does anyone know of any such project?

+1  A: 

FitNess should have both. I know that fitness has a very high test coverage and takes pride in clean code. I`m not completely sure if there are integration tests, but since fitNess is an acceptance test framework they probably have every kind of test type in place.

You`ll find the source here http://fitnesse.org/ under download

Egil
Thanks. I just checked the source code for FitNesse. Under "src/fitnesse/" I found "FitNesseExpediter.java" and "FitNesseExpediterTest.java", among many other pairs of production/test classes. Unfortunately, there is only one test suite that I could find, and those tests seem to be mostly integration tests. Take "testAuthenticationGetsCalled" for example: it asserts that "response.getStatus()" is 401, but the method tested ("createGoodResponse") actually delegates this responsability to another class, "Responder".
Rogerio
A: 

CruiseControl has both unit tests and functional tests. Most (all?) of the functional tests are for the newest component, the Dashboard. But if you restrict what you're looking at to just that component you'll find both unit tests and functional tests.

Jeffrey Fredrick
Thanks. I had a look at those tests, and there are indeed developer tests, both unit and functional, for the Dashboard component.Those functional tests are written in JUnit using JWebUnit (and some using Selenium). I wonder if in such a case integration and functional tests are really no different...
Rogerio
+1  A: 

Have a look at tapestry web-framework. from code-quality perspective one of the best pieces of code i have seen! it uses both unit-tests and integration-tests (selenium driven). they are nicely integrated with maven so you can just run them locally. i would have preferred canoo-webtest (browser independent), but the suites are nice.

but you are right, all a mandating (automated) unit+integration tests, but you hardly see it in practice... though it really pays off!

manuel aldana
Thanks, this is more like what I was looking for. The unit tests use the EasyMock mocking library, while integration tests use Selenium... very good indeed.
Rogerio