Package org.infinispan.objectfilter

Examples of org.infinispan.objectfilter.Matcher.match()


         public void onFilterResult(Object instance, Object[] projection, Comparable[] sortProjection) {
            matchCount[0]++;
         }
      });

      matcher.match(obj);
      return matchCount[0] == 1;
   }

   protected boolean match(Query query, Object obj) throws Exception {
      Matcher matcher = createMatcher();
View Full Code Here


         public void onFilterResult(Object instance, Object[] projection, Comparable[] sortProjection) {
            matchCount[0]++;
         }
      });

      matcher.match(obj);
      return matchCount[0] == 1;
   }

   @Test
   public void shouldRaiseExceptionDueToUnknownAlias() throws Exception {
View Full Code Here

         public void onFilterResult(Object instance, Object[] projection, Comparable[] sortProjection) {
            matchCount[1]++;
         }
      });

      matcher.match(createPerson1());

      // assert that only one of the filters matched and the callback of the other was not invoked
      assertEquals(1, matchCount[0]);
      assertEquals(1, matchCount[1]);
   }
View Full Code Here

         public void onFilterResult(Object instance, Object[] projection, Comparable[] sortProjection) {
            sortProjections.add(sortProjection);
         }
      });

      matcher.match(createPerson1());
      matcher.match(createPerson2());

      assertEquals(2, sortProjections.size());

      Collections.sort(sortProjections, filterSubscription.getComparator());
View Full Code Here

            sortProjections.add(sortProjection);
         }
      });

      matcher.match(createPerson1());
      matcher.match(createPerson2());

      assertEquals(2, sortProjections.size());

      Collections.sort(sortProjections, filterSubscription.getComparator());
View Full Code Here

         }
      });

      ObjectFilter objectFilter = matcher.getObjectFilter(filterSubscription);

      matcher.match(person);
      assertEquals(1, matchCount[0]);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertTrue(result.getInstance() == person);
View Full Code Here

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertNotNull(result);
      assertTrue(result.getInstance() == person);

      matcher.match(person);
      assertTrue(b[0]);
   }


   @Test
View Full Code Here

         public void onFilterResult(Object instance, Object[] projection, Comparable[] sortProjection) {
            matchCount[0]++;
         }
      });

      matcher.match(person);

      assertEquals(1, matchCount[0]);

      matcher.unregisterFilter(filterSubscription);
      matcher.match(person);
View Full Code Here

      matcher.match(person);

      assertEquals(1, matchCount[0]);

      matcher.unregisterFilter(filterSubscription);
      matcher.match(person);

      // check that unregistration really took effect
      assertEquals(1, matchCount[0]);
   }
View Full Code Here

      assertNotNull(filterSubscription.getProjection());
      assertEquals(2, filterSubscription.getProjection().length);
      assertEquals("name", filterSubscription.getProjection()[0]);
      assertEquals("address.postCode", filterSubscription.getProjection()[1]);

      matcher.match(person);

      matcher.unregisterFilter(filterSubscription);

      assertEquals(1, result.size());
      assertEquals(2, result.get(0).length);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.