示例#1
0
 /**
  * Finds documents in path.
  *
  * @throws Exception exception
  */
 @Test
 public void findDocs() throws Exception {
   final String find = "collection('" + NAME + "/test/zipped') ";
   try (final QueryProcessor qp = new QueryProcessor(find, context)) {
     assertEquals(4, qp.execute().size());
   }
 }
示例#2
0
 /**
  * Checks if the constructed base-uri matches the base-uri of added documents.
  *
  * @throws Exception exception
  */
 @Test
 public void baseUri() throws Exception {
   final String find = "base-uri(collection('" + NAME + '/' + DIR + "xmark.xml'))";
   try (final QueryProcessor qp = new QueryProcessor(find, context)) {
     assertEquals(NAME + '/' + FILES[1], qp.execute().toString());
   }
 }
示例#3
0
 /**
  * Finds single doc.
  *
  * @throws Exception exception
  */
 @Test
 public void findDoc() throws Exception {
   final String find =
       "for $x in collection('"
           + NAME
           + '/'
           + DIR
           + "xmark.xml') "
           + "where $x//location contains text 'uzbekistan' "
           + "return $x";
   try (final QueryProcessor qp = new QueryProcessor(find, context)) {
     assertEquals(1, qp.execute().size());
   }
 }