From 228ad7f4393fcd995a7cf5a880539b0ab52fd220 Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Tue, 30 Oct 2012 11:19:32 +0000 Subject: [PATCH] SOLR-1972: Ignore metrics threads in SolrJ tests git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1403667 13f79535-47bb-0310-9956-ffa450edef68 --- .../embedded/TestEmbeddedSolrServer.java | 5 ++++ .../solrj/embedded/TestSolrProperties.java | 28 ++++++++++++------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServer.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServer.java index fc8b6fea3c3..390a657fb04 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServer.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServer.java @@ -23,6 +23,7 @@ import java.util.List; import junit.framework.Assert; +import org.apache.solr.SolrIgnoredThreadsFilter; import org.apache.solr.core.SolrCore; import org.junit.Rule; import org.junit.rules.RuleChain; @@ -31,7 +32,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule; +import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters; +@ThreadLeakFilters(defaultFilters = true, filters = { + SolrIgnoredThreadsFilter.class +}) public class TestEmbeddedSolrServer extends AbstractEmbeddedSolrServerTestCase { @Rule diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java index 00cb146b0d9..fa05a26c85c 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java @@ -17,20 +17,17 @@ package org.apache.solr.client.solrj.embedded; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStreamReader; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.xpath.*; - +import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters; +import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule; import org.apache.commons.io.IOUtils; +import org.apache.solr.SolrIgnoredThreadsFilter; import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrServer; import org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION; -import org.apache.solr.client.solrj.request.*; +import org.apache.solr.client.solrj.request.CoreAdminRequest; +import org.apache.solr.client.solrj.request.QueryRequest; +import org.apache.solr.client.solrj.request.UpdateRequest; import org.apache.solr.client.solrj.response.CoreAdminResponse; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.core.CoreContainer; @@ -44,12 +41,23 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Node; -import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStreamReader; /** * * @since solr 1.3 */ +@ThreadLeakFilters(defaultFilters = true, filters = { + SolrIgnoredThreadsFilter.class +}) public class TestSolrProperties extends AbstractEmbeddedSolrServerTestCase { protected static Logger log = LoggerFactory.getLogger(TestSolrProperties.class);