You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/08/27 22:37:43 UTC
[lucene-solr] 03/10: Un-ignore ref_guide tests
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 77ae58591736ee11f097100e18e637609fd6a7a4
Author: Timothy Potter <th...@gmail.com>
AuthorDate: Wed Aug 26 12:25:19 2020 -0600
Un-ignore ref_guide tests
---
.../ref_guide_examples/JsonRequestApiHeatmapFacetingTest.java | 11 ++---------
.../solr/client/ref_guide_examples/JsonRequestApiTest.java | 2 --
.../ref_guide_examples/UsingSolrJRefGuideExamplesTest.java | 7 +++----
3 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/JsonRequestApiHeatmapFacetingTest.java b/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/JsonRequestApiHeatmapFacetingTest.java
index 1204caa..f53233e 100644
--- a/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/JsonRequestApiHeatmapFacetingTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/JsonRequestApiHeatmapFacetingTest.java
@@ -32,7 +32,6 @@ import org.apache.solr.cloud.SolrCloudTestCase;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.util.ExternalPaths;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -44,7 +43,6 @@ import org.junit.Test;
* The test was duplicated here as the community has previously decided that it's best to keep all buildable ref-guide
* snippets together in the same package.
*/
-@Ignore // nocommit debug - flakey test
public class JsonRequestApiHeatmapFacetingTest extends SolrCloudTestCase {
private static final String COLLECTION_NAME = "spatialdata";
private static final String CONFIG_NAME = "spatialdata_config";
@@ -57,7 +55,7 @@ public class JsonRequestApiHeatmapFacetingTest extends SolrCloudTestCase {
.configure();
final List<String> solrUrls = new ArrayList<>();
- solrUrls.add(cluster.getJettySolrRunner(0).getBaseUrl().toString());
+ solrUrls.add(cluster.getJettySolrRunner(0).getBaseUrl());
CollectionAdminRequest.createCollection(COLLECTION_NAME, CONFIG_NAME, 1, 1).process(cluster.getSolrClient());
@@ -69,12 +67,7 @@ public class JsonRequestApiHeatmapFacetingTest extends SolrCloudTestCase {
final SolrInputDocument doc2 = new SolrInputDocument("id", "1", FIELD, "ENVELOPE(-120, -110, 80, 20)");
final SolrInputDocument doc3 = new SolrInputDocument("id", "3", FIELD, "POINT(70 60)");
final SolrInputDocument doc4 = new SolrInputDocument("id", "4", FIELD, "POINT(91 89)");
- final List<SolrInputDocument> docs = new ArrayList<>();
- docs.add(doc1);
- docs.add(doc2);
- docs.add(doc3);
- docs.add(doc4);
-
+ final List<SolrInputDocument> docs = Arrays.asList(doc1, doc2, doc3, doc4);
cluster.getSolrClient().add(COLLECTION_NAME, docs);
cluster.getSolrClient().commit(COLLECTION_NAME);
}
diff --git a/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/JsonRequestApiTest.java b/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/JsonRequestApiTest.java
index e75c83b..ffe452f 100644
--- a/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/JsonRequestApiTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/JsonRequestApiTest.java
@@ -44,7 +44,6 @@ import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.util.ExternalPaths;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -52,7 +51,6 @@ import org.junit.Test;
*
* Snippets surrounded by "tag" and "end" comments are extracted and used in the Solr Reference Guide.
*/
-@Ignore // nocommit debug some leak
public class JsonRequestApiTest extends SolrCloudTestCase {
private static final String COLLECTION_NAME = "techproducts";
private static final String CONFIG_NAME = "techproducts_config";
diff --git a/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/UsingSolrJRefGuideExamplesTest.java b/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/UsingSolrJRefGuideExamplesTest.java
index f2625c1..7cac89d 100644
--- a/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/UsingSolrJRefGuideExamplesTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/UsingSolrJRefGuideExamplesTest.java
@@ -46,7 +46,6 @@ import org.apache.solr.util.ExternalPaths;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -54,13 +53,12 @@ import org.junit.Test;
*
* Snippets surrounded by "tag" and "end" comments are extracted and used in the Solr Reference Guide.
*/
-@Ignore // nocommit debug - flakey test
public class UsingSolrJRefGuideExamplesTest extends SolrCloudTestCase {
private static final int NUM_INDEXED_DOCUMENTS = 3;
private static final int NUM_LIVE_NODES = 1;
- private Queue<String> expectedLines = new ArrayDeque();
+ private final Queue<String> expectedLines = new ArrayDeque<>();
@BeforeClass
public static void setUpCluster() throws Exception {
@@ -215,13 +213,14 @@ public class UsingSolrJRefGuideExamplesTest extends SolrCloudTestCase {
}
}
+ @SuppressWarnings("unchecked")
@Test
public void otherSolrApisExample() throws Exception {
expectLine("Found "+NUM_LIVE_NODES+" live nodes");
// tag::solrj-other-apis[]
final SolrClient client = getSolrClient();
- final SolrRequest request = new CollectionAdminRequest.ClusterStatus();
+ final SolrRequest<CollectionAdminResponse> request = new CollectionAdminRequest.ClusterStatus();
final NamedList<Object> response = client.request(request);
final NamedList<Object> cluster = (NamedList<Object>) response.get("cluster");