Apache Solr open-source search software
SOLR-1792: Documented peculiar behavior of TestHarness.LocalRequestFactory
Chris M. Hostetter83fc525d6004
diff --git a/CHANGES.txt b/CHANGES.txtindex 63bcad5af24..b5a5e7d0fd9 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -260,6 +260,9 @@ Documentation* SOLR-1590: Javadoc for XMLWriter#startTag(Chris A. Mattmann via hossman)+* SOLR-1792: Documented peculiar behavior of TestHarness.LocalRequestFactory+ (hossman)+================== Release 1.4.0 ==================Release Date: See http://lucene.apache.org/solr for the official release date.diff --git a/src/java/org/apache/solr/util/TestHarness.java b/src/java/org/apache/solr/util/TestHarness.javaindex 5b916ce35c9..1d069df57d2 100644--- a/src/java/org/apache/solr/util/TestHarness.java+++ b/src/java/org/apache/solr/util/TestHarness.java@@ -552,6 +552,24 @@ public class TestHarness {public Map<String,String> args = new HashMap<String,String>();public LocalRequestFactory() {}+ /**+ * Creates a LocalSolrQueryRequest based on variable args; for+ * historical reasons, this method has some peculiar behavior:+ * <ul>+ * <li>If there is a single arg, then it is treated as the "q"+ * param, and the LocalSolrQueryRequest consists of that query+ * string along with "qt", "start", and "rows" params (based+ * on the qtype, start, and limit properties of this factory)+ * along with any other default "args" set on this factory.+ * </li>+ * <li>If there are multiple args, then there must be an even number+ * of them, and each pair of args is used as a key=value param in+ * the LocalSolrQueryRequest. <b>NOTE: In this usage, the "qtype",+ * "start", "limit", and "args" properties of this factory are+ * ignored.</b>+ * </li>+ * </ul>+ */public LocalSolrQueryRequest makeRequest(String ... q) {if (q.length==1) {return new LocalSolrQueryRequest(TestHarness.this.getCore(),