From 273c083db0413758abf20d757eedbe3046b69e6f Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Tue, 23 Mar 2010 21:32:01 +0000 Subject: [PATCH] tests: ignore expected exceptions git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@926793 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/solr/handler/component/FacetComponent.java | 9 +++++++++ .../apache/solr/client/solrj/SolrExampleTestBase.java | 1 + 2 files changed, 10 insertions(+) diff --git a/solr/src/java/org/apache/solr/handler/component/FacetComponent.java b/solr/src/java/org/apache/solr/handler/component/FacetComponent.java index 9a46a947b51..78fc84b7480 100644 --- a/solr/src/java/org/apache/solr/handler/component/FacetComponent.java +++ b/solr/src/java/org/apache/solr/handler/component/FacetComponent.java @@ -256,6 +256,15 @@ public class FacetComponent extends SearchComponent // step through each facet.field, adding results from this shard NamedList facet_fields = (NamedList)facet_counts.get("facet_fields"); + + // an error could cause facet_fields to come back null + if (facet_fields == null) { + String msg = (String)facet_counts.get("exception"); + if (msg == null) msg = "faceting exception in sub-request - missing facet_fields"; + throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, msg); + + } + for (DistribFieldFacet dff : fi.facets.values()) { dff.add(shardNum, (NamedList)facet_fields.get(dff.getKey()), dff.initialLimit); } diff --git a/solr/src/test/org/apache/solr/client/solrj/SolrExampleTestBase.java b/solr/src/test/org/apache/solr/client/solrj/SolrExampleTestBase.java index b4dc835c622..d9725aafd93 100644 --- a/solr/src/test/org/apache/solr/client/solrj/SolrExampleTestBase.java +++ b/solr/src/test/org/apache/solr/client/solrj/SolrExampleTestBase.java @@ -38,6 +38,7 @@ abstract public class SolrExampleTestBase extends AbstractSolrTestCase @Override public void setUp() throws Exception { + ignoreException("maxWarmingSearchers"); super.setUp(); // this sets the property for jetty starting SolrDispatchFilter