You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2018/07/25 08:34:13 UTC
[31/33] lucene-solr:jira/http2: SOLR-11598: Fix test failure due to
ordering of sub-tests
SOLR-11598: Fix test failure due to ordering of sub-tests
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a254e7d7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a254e7d7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a254e7d7
Branch: refs/heads/jira/http2
Commit: a254e7d7bcd11c2163dfbb7b3d4a3986aee7867b
Parents: 98d463a
Author: Varun Thacker <va...@apache.org>
Authored: Tue Jul 24 13:08:06 2018 -0700
Committer: Varun Thacker <va...@apache.org>
Committed: Tue Jul 24 13:09:04 2018 -0700
----------------------------------------------------------------------
.../solr/handler/export/TestExportWriter.java | 31 +++++++++++++-------
1 file changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a254e7d7/solr/core/src/test/org/apache/solr/handler/export/TestExportWriter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/export/TestExportWriter.java b/solr/core/src/test/org/apache/solr/handler/export/TestExportWriter.java
index e431f47..0d1a9a0 100644
--- a/solr/core/src/test/org/apache/solr/handler/export/TestExportWriter.java
+++ b/solr/core/src/test/org/apache/solr/handler/export/TestExportWriter.java
@@ -55,7 +55,7 @@ public class TestExportWriter extends SolrTestCaseJ4 {
super.setUp();
assertU(delQ("*:*"));
assertU(commit());
- createIndex();
+
}
public static void createIndex() {
@@ -149,6 +149,19 @@ public class TestExportWriter extends SolrTestCaseJ4 {
}
@Test
+ public void test() throws Exception {
+ clearIndex();
+ createIndex();
+
+ testSortingOutput();
+ testExportRequiredParams();
+ testDates();
+ testDuplicates();
+
+ clearIndex();
+ }
+
+ @Test
public void testSmallChains() throws Exception {
clearIndex();
@@ -331,8 +344,7 @@ public class TestExportWriter extends SolrTestCaseJ4 {
" \"id\":\"2\"}]}}");
}
- @Test
- public void testSortingOutput() throws Exception {
+ private void testSortingOutput() throws Exception {
//Test single value DocValue output
String s = h.query(req("q", "id:1", "qt", "/export", "fl", "floatdv,intdv,stringdv,longdv,doubledv", "sort", "intdv asc"));
@@ -436,8 +448,7 @@ public class TestExportWriter extends SolrTestCaseJ4 {
assertEquals(Utils.toJSONString(Utils.fromJSONString(expected)), Utils.toJSONString(Utils.fromJSONString(actual)));
}
- @Test
- public void testExportRequiredParams() throws Exception {
+ private void testExportRequiredParams() throws Exception {
//Test whether missing required parameters returns expected errors.
@@ -451,17 +462,15 @@ public class TestExportWriter extends SolrTestCaseJ4 {
// Interesting you don't even need to specify a "q" parameter.
}
-
- @Test
- public void testDates() throws Exception {
+
+ private void testDates() throws Exception {
String s = h.query(req("q", "id:1", "qt", "/export", "fl", "datedv", "sort", "datedv asc"));
assertJsonEquals(s, "{\"responseHeader\": {\"status\": 0}, \"response\":{\"numFound\":1, \"docs\":[{\"datedv\":\"2017-06-16T07:00:00Z\"}]}}");
s = h.query(req("q", "id:1", "qt", "/export", "fl", "datedv_m", "sort", "datedv asc"));
assertJsonEquals(s, "{\"responseHeader\": {\"status\": 0}, \"response\":{\"numFound\":1, \"docs\":[{\"datedv_m\":[\"2017-06-16T01:00:00Z\",\"2017-06-16T02:00:00Z\",\"2017-06-16T03:00:00Z\",\"2017-06-16T04:00:00Z\"]}]}}");
}
-
- @Test
- public void testDuplicates() throws Exception {
+
+ private void testDuplicates() throws Exception {
// see SOLR-10924
String expected = h.getCore().getLatestSchema().getField("int_is_t").getType().isPointField()
? "1,1,1,1" : "1";