Package org.infinispan.query

Examples of org.infinispan.query.ResultIterator


   public void testEagerIterator() throws ParseException {
      loadTestingData();
      CacheQuery cacheQuery = createCacheQuery(cache, "blurb", "playing" );

      ResultIterator found = cacheQuery.iterator(new FetchOptions().fetchMode(FetchOptions.FetchMode.EAGER));

      try {
         assert found.hasNext();
         found.next();
         assert !found.hasNext();
      } finally {
         found.close();
      }
      StaticTestingErrorHandler.assertAllGood(cache);
   }
View Full Code Here


   @Test(expectedExceptions = UnsupportedOperationException.class)
   public void testEagerIteratorRemove() throws ParseException {
      loadTestingData();
      CacheQuery cacheQuery = createCacheQuery(cache, "blurb", "playing" );

      ResultIterator found = cacheQuery.iterator(new FetchOptions().fetchMode(FetchOptions.FetchMode.EAGER));

      try {
         assert found.hasNext();
         found.remove();
      } finally {
         found.close();
      }
   }
View Full Code Here

   @Test(expectedExceptions = NoSuchElementException.class)
   public void testEagerIteratorExCase() throws ParseException {
      loadTestingData();
      CacheQuery cacheQuery = createCacheQuery(cache, "blurb", "playing" );

      ResultIterator found = cacheQuery.iterator(new FetchOptions().fetchMode(FetchOptions.FetchMode.EAGER));

      try {
         assert found.hasNext();
         found.next();
         assert !found.hasNext();
         found.next();
      } finally {
         found.close();
      }
   }
View Full Code Here

      loadTestingData();
      queryParser = createQueryParser("blurb");
      Query luceneQuery = queryParser.parse("playing");
      CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(luceneQuery);

      ResultIterator found = cacheQuery.iterator(new FetchOptions().fetchMode(FetchOptions.FetchMode.LAZY));

      try {
         assert found.hasNext();
         found.next();
         assert !found.hasNext();
      } finally {
         found.close();
      }
      StaticTestingErrorHandler.assertAllGood(cache);
   }
View Full Code Here

      loadTestingData();
      queryParser = createQueryParser("blurb");
      Query luceneQuery = queryParser.parse("playing");
      CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(luceneQuery);

      ResultIterator found = cacheQuery.iterator(new FetchOptions(){
         public FetchOptions fetchMode(FetchMode fetchMode) {
            return null;
         }
      });

      try {
         assert found.hasNext();
         found.next();
         assert !found.hasNext();
      } finally {
         found.close();
      }
   }
View Full Code Here

      loadTestingData();
      queryParser = createQueryParser("blurb");
      Query luceneQuery = queryParser.parse("playing");
      CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(luceneQuery);

      ResultIterator found = cacheQuery.iterator();

      try {
         assert found.hasNext();
         found.next();
         assert !found.hasNext();
      } finally {
         found.close();
      }
      StaticTestingErrorHandler.assertAllGood(cache);
   }
View Full Code Here

      queryParser = createQueryParser("blurb");
      Query luceneQuery = queryParser.parse("Eats");

      CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(luceneQuery);
      ResultIterator iterator = cacheQuery.iterator();
      try {
         if (iterator.hasNext()) {
            Object next = iterator.next();
            iterator.remove();
         }
      } finally {
         iterator.close();
      }
      StaticTestingErrorHandler.assertAllGood(cache);
   }
View Full Code Here

      loadTestingData();
      queryParser = createQueryParser("blurb");
      Query luceneQuery = queryParser.parse("Eats");
      CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(luceneQuery).firstResult(1);

      ResultIterator iterator = cacheQuery.iterator(new FetchOptions().fetchMode(FetchOptions.FetchMode.LAZY));
      try {
         assertEquals(2, countElements(iterator));
      } finally {
         iterator.close();
      }
      StaticTestingErrorHandler.assertAllGood(cache);
   }
View Full Code Here

      loadTestingData();
      queryParser = createQueryParser("blurb");
      Query luceneQuery = queryParser.parse("Eats");
      CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(luceneQuery).firstResult(1);

      ResultIterator found = cacheQuery.iterator(new FetchOptions().fetchMode(FetchOptions.FetchMode.LAZY).fetchSize(0));
   }
View Full Code Here

      loadTestingData();
      queryParser = createQueryParser("blurb");
      Query luceneQuery = queryParser.parse("fish");
      CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(luceneQuery).firstResult(1);

      ResultIterator found = cacheQuery.iterator(new FetchOptions().fetchMode(FetchOptions.FetchMode.LAZY));

      try {
         found.next();
      } finally {
         found.close();
      }
   }
View Full Code Here

TOP

Related Classes of org.infinispan.query.ResultIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.