You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2017/06/14 02:02:55 UTC

[19/35] lucene-solr:jira/SOLR-10834: SOLR-10818: Adding test for v2 backup-collection request

SOLR-10818: Adding test for v2 backup-collection request


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b73dffd9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b73dffd9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b73dffd9

Branch: refs/heads/jira/SOLR-10834
Commit: b73dffd928af2a34afdf1554a62d417e024b593c
Parents: 833a6f3
Author: Cao Manh Dat <da...@apache.org>
Authored: Tue Jun 13 19:38:43 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Tue Jun 13 19:38:43 2017 +0700

----------------------------------------------------------------------
 .../test/org/apache/solr/handler/V2ApiIntegrationTest.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b73dffd9/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
index 66f5dbe..881e68b 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
@@ -18,6 +18,7 @@
 package org.apache.solr.handler;
 
 
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -37,8 +38,6 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class V2ApiIntegrationTest extends SolrCloudTestCase {
-  private List<RestTestHarness> restTestHarnesses = new ArrayList<>();
-
   private static String COLL_NAME = "collection1";
 
   @BeforeClass
@@ -99,6 +98,11 @@ public class V2ApiIntegrationTest extends SolrCloudTestCase {
     assertEquals("/c/collection1/get", Utils.getObjectByPath(result, true, "/spec[0]/url/paths[0]"));
     result = resAsMap(client, new V2Request.Builder("/collections/"+COLL_NAME+"/get/_introspect").build());
     assertEquals("/collections/collection1/get", Utils.getObjectByPath(result, true, "/spec[0]/url/paths[0]"));
+    String tempDir = createTempDir().toFile().getPath();
+    client.request(new V2Request.Builder("/c")
+        .withMethod(SolrRequest.METHOD.POST)
+        .withPayload("{backup-collection:{name: backup_test, collection: "+COLL_NAME+" , location: '"+tempDir+"' }}")
+        .build());
   }
 
   private Map resAsMap(CloudSolrClient client, V2Request request) throws SolrServerException, IOException {