2

I have the following project setup:

enter image description here

The application consists of several projects where each project have a test package. These test packages contain the test classes for this particular project and also a TestAll class which runs all tests in this package. The TestAll class looks like this:

@RunWith(Suite.class)
@Suite.SuiteClasses( {
    TestClass1.class,
    TestClass2.class,
    TestClassX.class

} )
public class TestAll {}

Would it be possible to run all these TestAll classes, in all projects at once? Right now I am manually running each TestAll class which is very timeconsuming. Preferly I would like the result to be saved somewhere but that is a later problem

Matthew Farwell
  • 60,889
  • 18
  • 128
  • 171
John Snow
  • 5,214
  • 4
  • 37
  • 44

1 Answers1

0

Resolved this by the hints given here: Run Junit-Tests from several projects conveniently fast in Eclipse

What I did was to create a new project, TestAllProjects, and added all the projects containing my tests in build path -> project

When this was done I created a TestAllClass in this project:

import path.to.package.containg.test.for.project1.testAll.*;
import path.to.package.containg.test.for.project2.testAll.*;
import path.to.package.containg.test.for.projectX.testAll.*;


@RunWith(Suite.class)
@Suite.SuiteClasses( {
    TestAllProject1.class, //Refrence to a TestAll class
    TestAllProject2.class, //Refrence to a TestAll class
    TestAllProjectX.class  //Refrence to a TestAll class

} )

public class TestAllProjects {}

Now when I run this, it will run all the TestAll classes i've created in each project, resulting in that all test classes are beeing run

Community
  • 1
  • 1
John Snow
  • 5,214
  • 4
  • 37
  • 44