Click here to Skip to main content
13,053,994 members (70,089 online)
Click here to Skip to main content
Add your own
alternative version


3 bookmarked
Posted 29 Nov 2013

Roger Rabbit - JUnit Tests Runner Across Multiple Projects

Rate this:
Please Sign up or sign in to vote.
Running JUnit tests across multiple projects


Roger Rabbit is a sample project that demonstrates how to use the open source classpath suite for running JUnit tests across multiple projects.


Imagine you are working on a product which consists of many Java projects. Each project has its own test suite, or even projects which their whole purpose is testing. When you make a change, you probably would like to run all relevant tests which can belong to many different projects. The naive way is to go project by project and run its test suite. This is, of course, exhausting...

Another option is to commit the change and let the CI do it for you, but this way the feedback is not immediate (you have to wait for compilation, other related jobs, etc.) and if the tests you want to run are unit tests - it is very fast and convenient to run those tests locally and get immediate feedback.
Roger Rabbit allows you to run all tests with one click.

How the Magic Works

Roger Rabbit is a project which has a dependency to classpath suite and to all projects that contain tests, we want to run (using project dependency, but you can also use Maven).
It has a single class file under utest folder which looks like this:

package com.rogerrabbit;

import org.junit.extensions.cpsuite.ClasspathSuite;
import org.junit.runner.RunWith;

public class TestRunner {}

Now, whenever you want to run all junit tests that Roger Rabbit depends on, all you have to do is run TestRunner class.

Points of Interest


Using Roger Rabbit, you can easily measure your entire code coverage. If you are familiar with Eclipse coverage plugin, it can be used when running TestRunner class and by that, it would check how much your code is covered.

Eclipse Launcher

If you're using Eclipse, we have added a roger-rabbit.launch file which adds to Run As and Debug As toolbar buttons a JUnit launcher.


If you’re using Maven, the library can be referenced like this:



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Authors

No Biography provided

No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 29 Nov 2013
Article Copyright 2013 by Effi Bar-She'an, Lital Kornfeld
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid