コード例 #1
0
ファイル: CollectionPathTest.java プロジェクト: LukasK/basex
 /**
  * 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
ファイル: CollectionPathTest.java プロジェクト: LukasK/basex
 /**
  * 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
ファイル: CollectionPathTest.java プロジェクト: LukasK/basex
 /**
  * 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());
   }
 }