You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by va...@apache.org on 2018/07/24 20:09:15 UTC
lucene-solr:branch_7x: SOLR-11598: Fix test failure due to ordering
of sub-tests
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x 3edd07b20 -> 3bf98da39
SOLR-11598: Fix test failure due to ordering of sub-tests
(cherry picked from commit dfc8697)
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/3bf98da3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3bf98da3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3bf98da3
Branch: refs/heads/branch_7x
Commit: 3bf98da39f36d862745be166a0a59303c4ed1714
Parents: 3edd07b
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:08:42 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/3bf98da3/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";