Author: vgritsenko
Date: Mon Jul 16 20:52:52 2007
New Revision: 556805

URL: http://svn.apache.org/viewvc?view=rev&rev=556805
Log:
add a failing test case

Modified:
    
xml/xindice/trunk/java/tests/src/org/apache/xindice/core/query/IndexedQueryTest.java

Modified: 
xml/xindice/trunk/java/tests/src/org/apache/xindice/core/query/IndexedQueryTest.java
URL: 
http://svn.apache.org/viewvc/xml/xindice/trunk/java/tests/src/org/apache/xindice/core/query/IndexedQueryTest.java?view=diff&rev=556805&r1=556804&r2=556805
==============================================================================
--- 
xml/xindice/trunk/java/tests/src/org/apache/xindice/core/query/IndexedQueryTest.java
 (original)
+++ 
xml/xindice/trunk/java/tests/src/org/apache/xindice/core/query/IndexedQueryTest.java
 Mon Jul 16 20:52:52 2007
@@ -49,14 +49,14 @@
         db.setConfig(new 
Configuration(DOMParser.toDocument(DatabaseTest.DATABASE)));
         collection = db.createCollection(name, new Configuration(
                 DOMParser.toDocument(
-                        "<collection compressed=\"true\" name=\"" + name + "\" 
inline-metadata=\"true\">" +
-                            "<filer 
class=\"org.apache.xindice.core.filer.BTreeFiler\" />" +
+                        "<collection compressed='true' name='" + name + "' 
inline-metadata='true'>" +
+                        "  <filer 
class='org.apache.xindice.core.filer.BTreeFiler'/>" +
                         "</collection>"), false
         ));
 
         String config = "<index name='Test' " +
                         "       
class='org.apache.xindice.core.indexer.ValueIndexer' " +
-                        "       pattern='test1' />";
+                        "       pattern='test1'/>";
         collection.createIndexer(new 
Configuration(DOMParser.toDocument(config)));
     }
 
@@ -94,4 +94,30 @@
 
         assertEquals(9, count);
     }
+
+    /* FIXME Search w/out index passes, but indexed search does not
+    public void testValueIndexer_StartsWithNestedContent() throws Exception {
+        collection.insertDocument("key1", DOMParser.toDocument("<test1>This 
<i>is</i> a test</test1>"));
+        collection.insertDocument("key2", DOMParser.toDocument("<test2>This 
<i>is</i> a test</test2>"));
+        assertEquals(2, collection.getFiler().getRecordCount());
+
+        XPathQueryResolver service = new XPathQueryResolver();
+        NodeSet result = service.query(collection, "//test2[starts-with(., 
'This is')]", null, null);
+        int count = 0;
+        while (result.hasMoreNodes()) {
+            result.getNextNode();
+            count++;
+        }
+        assertEquals(1, count);
+
+        result = service.query(collection, "//test1[starts-with(., 'This 
is')]", null, null);
+        count = 0;
+        while (result.hasMoreNodes()) {
+            result.getNextNode();
+            count++;
+        }
+        assertEquals(1, count);
+
+    }
+    */
 }


Reply via email to