Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Problems rerunning specific tests with dynamically generated TestSuite(Using @RunWith(AllTests.class), but can't rerun classes or suites and get "The input type of the launch configuration does not exist")
Problems rerunning specific tests with dynamically generated TestSuite [message #1000325] Mon, 14 January 2013 14:30
Tobias Bertelsen is currently offline Tobias BertelsenFriend
Messages: 25
Registered: October 2011
Junior Member
I'm working in a OSGi environment with 50+ test bundles. To avoid manually maintaining project dependencies, test suites etc. we want to generate test suites at runtime, by scanning the loaded bundles, inspired by this blog post. My test suites look something like the one below:

@RunWith(AllTests.class)
public class MtTryTestSuite {
  public static TestSuite suite() {
    // Find all test classes in loaded bundles:
    Bundle[] bundles = Activator.getDefault().getBundleContext().getBundles();
    List<Class<?>> testClasses = findAllTests(bundles);
    
    // Add them all to the test suite
    final TestSuite suite = new TestSuite();
    for (Class<?> clazz : testClasses) {
      suite.addTest(new JUnit4TestAdapter(clazz));
    }
    return suite;
  }
}


Running the tests works pretty fine, but I have two problems when I want to rerun a specific test.

Problem 1
Normally I'm able to right click on a suite, a class or a method and select "run". When using the @RunWith(AllTests.class) runner, I can only do this on methods. The "run" option is gone when I right click a suite or a class.

Problem 2
When I click "run" on a method I'm presented with the following error

Could not rerun test
The input type of the launch configuration does not exist


I have look into this error, and people primarily see it when they don't have their tests is a source folder. My tests are in a source folder, but in another project than the suite. I have found a workaround which is: To the project of the suite add a project dependency to the project of the test. This is however a bad solution, since it require us to manually maintain an extra redundant list of dependencies, and thereby partly defeats the purpose of generating the suite dynamically.



I will greatly appreciate if anybody know if there exist a proper solution to these two problems, or if they should be filed as bugs.

Thanks
Tobias Smile

Previous Topic:Eclipse cant run JUnit tests with "Failures First" when using @RunWith{AllTests.class}
Next Topic:JUnit Support extensibility : run tests from classpath jars
Goto Forum:
  


Current Time: Wed Sep 18 23:24:37 GMT 2024

Powered by FUDForum. Page generated in 0.03750 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top