Package com.linkedin.data.it.IteratorTestData

Examples of com.linkedin.data.it.IteratorTestData.SimpleTestData


public class TestCounter
{
  @Test
  public void testCountByPredicateAtPath() throws Exception
  {
    SimpleTestData data = IteratorTestData.createSimpleTestData();
   
    int count = Builder.create(data.getDataElement(), IterationOrder.PRE_ORDER)
        .filterBy(Predicates.pathMatchesPathSpec(IteratorTestData.PATH_TO_ID))
        .count();
   
    assertEquals(3, count);
  }
View Full Code Here


  }
 
  @Test
  public void testCountByPredicateAtPathWithFilter() throws Exception
  {
    SimpleTestData data = IteratorTestData.createSimpleTestData();
   
    int count = Builder.create(data.getDataElement(), IterationOrder.PRE_ORDER)
        .filterBy(Predicates.and(Predicates.pathMatchesPathSpec(IteratorTestData.PATH_TO_ID), IteratorTestData.LESS_THAN_3_CONDITION))
        .count();
   
    assertEquals(2, count);
  }
View Full Code Here

public class TestValueAccumulator
{
  @Test
  public void testAccumulateByPath() throws Exception
  {
    SimpleTestData data = IteratorTestData.createSimpleTestData();
   
    List<Object> ids = new LinkedList<Object>();
   
    Builder.create(data.getDataElement(), IterationOrder.PRE_ORDER)
      .filterBy(Predicates.and(Predicates.pathMatchesPattern("foo", Wildcard.ANY_ONE, "id")))
      .accumulateValues(ids);

    assertEquals(3, ids.size());
    assertTrue(ids.contains(1));
View Full Code Here

  }

  @Test
  public void testAccumulateByPathAndFilter() throws Exception
  {
    SimpleTestData data = IteratorTestData.createSimpleTestData();
   
    List<Object> ids = new ArrayList<Object>(
        Builder.create(data.getDataElement(), IterationOrder.PRE_ORDER)
        .filterBy(Predicates.and(Predicates.pathMatchesPathSpec(IteratorTestData.PATH_TO_ID), IteratorTestData.LESS_THAN_3_CONDITION))
        .accumulateValues());

    assertEquals(2, ids.size());
    assertTrue(ids.contains(1));
View Full Code Here

TOP

Related Classes of com.linkedin.data.it.IteratorTestData.SimpleTestData

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.