lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r820079 - /lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTest.java
Date Tue, 29 Sep 2009 20:11:15 GMT
Author: shalin
Date: Tue Sep 29 20:11:15 2009
New Revision: 820079

URL: http://svn.apache.org/viewvc?rev=820079&view=rev
Log:
Pass the same parameters by default as the other runFullImport method

Modified:
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTest.java

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTest.java?rev=820079&r1=820078&r2=820079&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTest.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTest.java
Tue Sep 29 20:11:15 2009
@@ -73,12 +73,26 @@
             dataConfig);
     h.query("/dataimport", request);
   }
-  protected void runFullImport(String dataConfig, Map<String ,String > extraParams)
throws Exception {
+
+  /**
+   * Runs a full-import using the given dataConfig and the provided request parameters.
+   *
+   * By default, debug=on, clean=true and commit=true are passed which can be overridden.
+   *
+   * @param dataConfig the data-config xml as a string
+   * @param extraParams any extra request parameters needed to be passed to DataImportHandler
+   * @throws Exception in case of any error
+   */
+  protected void runFullImport(String dataConfig, Map<String, String> extraParams)
throws Exception {
+    HashMap<String, String> params = new HashMap<String, String>();
+    params.put("command", "full-import");
+    params.put("debug", "on");
+    params.put("dataConfig", dataConfig);
+    params.put("clean", "true");
+    params.put("commit", "true");
+    params.putAll(extraParams);
     NamedList l = new NamedList();
-    l.add("command", "full-import");
-    l.add("debug", "on");
-    l.add("dataConfig", dataConfig);
-    for (Map.Entry<String, String> e : extraParams.entrySet()) {
+    for (Map.Entry<String, String> e : params.entrySet()) {
       l.add(e.getKey(),e.getValue());
     }
     LocalSolrQueryRequest request = new LocalSolrQueryRequest(h.getCore(), l);  



Mime
View raw message