mardi 13 septembre 2016

Set classpath for Unittests

I use cpsuite to create testsuits dynamically. I have several projects with some dependencies between them, and I want to have a launch configuration to launch all tests in all the projects.

It works for most of my tests, but some tests depend on test data that is part of the project. When I run the tests with my configuration, the tests can't find the files because they're run from the Suite class which is in another project.

I tried adding all projects to the run configuration, but just can't get it to work.

cpsuite also has a annotation @ClasspathProperty to modify the classpath, but I'm not sure how to use it correctly, or if it's right for what I want to do.

This is one of my TestSuits I use for collecting all Testclasses.

@RunWith(ClasspathSuite.class)
@ClasspathProperty("")
@ClassnameFilters({ ".*Test.*" })
public final class cAllTestSuite
{

}

Any help appreciated, if there's more info needed just ask, I'm not sure what might be useful.

Aucun commentaire:

Enregistrer un commentaire