Permalink
Browse files

Added tests for querying against unindexed fields.

  • Loading branch information...
1 parent c047671 commit 0f66e693e96f746c87a5672dabcebc82ac201f5b cjdelisle committed Jun 11, 2011
@@ -14,6 +14,8 @@
private String notIndexed;
+ private String alsoNotIndexed;
+
@Index
private String content;
@@ -28,6 +30,7 @@ public Document(String title, String author, String content, final String notInd
this.author = author;
this.content = content;
this.notIndexed = notIndexed;
+ this.alsoNotIndexed = "Hi";
}
public String getAuthor()
@@ -69,13 +69,29 @@ public void testSearchByAuthor() throws Exception
@Test
public void testSearchByContent() throws Exception
{
- searchDocuments("SELECT FROM org.xwiki.store.datanucleus.test.Document WHERE content == \"ContentA\"");
+ searchDocuments("SELECT FROM org.xwiki.store.datanucleus.test.Document WHERE "
+ + "content == \"ContentA\"");
}
@Test
public void testSearchByContentAndNonIndexed() throws Exception
{
- searchDocuments("SELECT FROM org.xwiki.store.datanucleus.test.Document WHERE content == \"ContentA\" && notIndexed == \"Hello\"");
+ searchDocuments("SELECT FROM org.xwiki.store.datanucleus.test.Document WHERE "
+ + "content == \"ContentA\" && notIndexed == \"Hello\"");
+ }
+
+ @Test
+ public void testSearchByNonIndexed() throws Exception
+ {
+ searchDocuments("SELECT FROM org.xwiki.store.datanucleus.test.Document WHERE "
+ + "notIndexed == \"Hello\"");
+ }
+
+ @Test
+ public void testSearchByTwoNonIndexed() throws Exception
+ {
+ searchDocuments("SELECT FROM org.xwiki.store.datanucleus.test.Document WHERE "
+ + "notIndexed == \"Hello\" && alsoNotIndexed == \"Hi\"");
}
@Test
@@ -109,7 +125,8 @@ public void testStoreLoadGroovyGeneratedClass() throws Exception
+ " public String toString()\n"
+ " {\n"
- + " return author + ' | ' + notIndexed + ' | ' + content + ' | ' + title + ' | ' + innerDocument.toString();\n"
+ + " return author + ' | ' + notIndexed + ' | ' + content + ' | '"
+ + " + title + ' | ' + innerDocument.toString();\n"
+ " }\n"
+ "}\n";

0 comments on commit 0f66e69

Please sign in to comment.