lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r813228 - /lucene/solr/trunk/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestXPathRecordReader.java
Date Thu, 10 Sep 2009 04:57:36 GMT
Author: noble
Date: Thu Sep 10 04:57:36 2009
New Revision: 813228

URL: http://svn.apache.org/viewvc?rev=813228&view=rev
Log:
new testcase for same forEach and xpath

Modified:
    lucene/solr/trunk/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestXPathRecordReader.java

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestXPathRecordReader.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestXPathRecordReader.java?rev=813228&r1=813227&r2=813228&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestXPathRecordReader.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestXPathRecordReader.java
Thu Sep 10 04:57:36 2009
@@ -299,5 +299,17 @@
     Assert.assertEquals("This is the body of my text", m.get("text").toString()
             .trim());
   }
-
+  @Test
+  public void sameForEachAndXpath(){
+    String xml="<root>\n" +
+            "   <cat>\n" +
+            "     <name>hello</name>\n" +
+            "   </cat>\n" +
+            "   <item name=\"item name\"/>\n" +
+            "</root>";
+    XPathRecordReader rr = new XPathRecordReader("/root/cat/name");
+    rr.addField("catName", "/root/cat/name",false);
+    List<Map<String, Object>> l = rr.getAllRecords(new StringReader(xml));
+    Assert.assertEquals("hello",l.get(0).get("catName"));
+  }
 }



Mime
View raw message