Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is causing "java.lang.Exception: … contains itself as a SuiteClass" #2

Open
pluess opened this issue Jan 26, 2015 · 2 comments

Comments

@pluess
Copy link

pluess commented Jan 26, 2015

I see a number of people on Stackoverflow (http://stackoverflow.com/questions/tagged/classpathsuite) getting a

 java.lang.Exception: class 'com.foo.bar.AllTests' (possibly indirectly) contains itself as a SuiteClass

I don't see this as a bug of cpsuite, but It would be helpfull to give a hint in the docs what the exception means and how to resolve it.

@mjball
Copy link

mjball commented Mar 30, 2016

Agreed, this is confusing. When combined with something like

@ClasspathSuite.SuiteTypes({SuiteType.TEST_CLASSES, SuiteType.RUN_WITH_CLASSES})

perhaps the @ClasspathSuite-annotated class itself is found while the runner scans for test classes?

@mjball
Copy link

mjball commented Mar 30, 2016

Indeed if you use ClassnameFilters to exclude com.foo.bar.AllTests, it solves the problem:

@ClasspathSuite.ClassnameFilters("!.*AllTests.*")

(that example may be too aggressive in its name matching)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants