diff --git a/solr/src/test/org/apache/solr/SolrInfoMBeanTest.java b/solr/src/test/org/apache/solr/SolrInfoMBeanTest.java index 5be10ec9175..f3d394c20ad 100644 --- a/solr/src/test/org/apache/solr/SolrInfoMBeanTest.java +++ b/solr/src/test/org/apache/solr/SolrInfoMBeanTest.java @@ -41,7 +41,6 @@ public class SolrInfoMBeanTest extends LuceneTestCase * Gets a list of everything we can find in the classpath and makes sure it has * a name, description, etc... */ - @Ignore("meddles with unrelated tests") public void testCallMBeanInfo() throws Exception { List classes = new ArrayList(); classes.addAll(getClassesForPackage(StandardRequestHandler.class.getPackage().getName())); @@ -91,7 +90,14 @@ public class SolrInfoMBeanTest extends LuceneTestCase String path = pckgname.replace('.', '/'); Enumeration resources = cld.getResources(path); while (resources.hasMoreElements()) { - directories.add(new File(resources.nextElement().toURI())); + final File f = new File(resources.nextElement().toURI()); + // only iterate classes from the core, not the tests + if (!f.toString().contains("build" + File.separator + "solr")) + continue; + // extra security :-) + if (f.toString().contains("tests")) + continue; + directories.add(f); } ArrayList classes = new ArrayList(); @@ -100,12 +106,6 @@ public class SolrInfoMBeanTest extends LuceneTestCase String[] files = directory.list(); for (String file : files) { if (file.endsWith(".class")) { - // FIXME: Find the static/sysprop/file leakage here. - // If we call Class.forName(ReplicationHandler) here, its test will later fail - // when run inside the same JVM (-Dtests.threadspercpu=0), so something is wrong. - if (file.contains("ReplicationHandler")) - continue; - classes.add(Class.forName(pckgname + '.' + file.substring(0, file.length() - 6))); } }