Package org.sindice.siren.qparser.json.dsl

Examples of org.sindice.siren.qparser.json.dsl.QueryBuilder


    parser.parse(query, "");
  }

  @Test
  public void testNodeWithQuery() throws QueryNodeException {
    final QueryBuilder build = new QueryBuilder();
    final NodeQuery node = build.newNode("aaa");
    assertParser(node);
  }
View Full Code Here


    assertParser(node);
  }

  @Test
  public void testNodeWithLevelAndRange() throws QueryNodeException {
    final QueryBuilder build = new QueryBuilder();
    final NodeQuery node = build.newNode("aaa")
                           .setLevel(1)
                           .setRange(1, 2);
    assertParser(node);
  }
View Full Code Here

    parser.parse(query, "");
  }

  @Test
  public void testEmptyTwig() throws QueryNodeException {
    final QueryBuilder build = new QueryBuilder();
    final TwigQuery twig = build.newTwig();
    assertParser(twig);
  }
View Full Code Here

    assertParser(twig);
  }

  @Test
  public void testTwigWithRootOnly() throws QueryNodeException {
    final QueryBuilder build = new QueryBuilder();
    final TwigQuery twig = build.newTwig("aaa");
    assertParser(twig);
  }
View Full Code Here

    assertParser(twig);
  }

  @Test
  public void testTwigWithRootLevelAndRange() throws QueryNodeException {
    final QueryBuilder build = new QueryBuilder();
    final TwigQuery twig = build.newTwig("aaa")
                                .setLevel(2)
                                .setRange(2, 5);
    assertParser(twig);
  }
View Full Code Here

    assertParser(twig);
  }

  @Test
  public void testTwigWithOneChild() throws QueryNodeException {
    final QueryBuilder build = new QueryBuilder();
    final TwigQuery twig = build.newTwig()
                                .with(build.newNode("aaa"));
    assertParser(twig);
  }
View Full Code Here

    assertParser(twig);
  }

  @Test
  public void testTwigWithMultipleChildren() throws QueryNodeException {
    final QueryBuilder build = new QueryBuilder();
    final TwigQuery twig = build.newTwig()
                                .with(build.newNode("aaa"))
                                .without(build.newNode("bbb"))
                                .optional(build.newTwig()
                                               .with(build.newNode("ccc")));
    assertParser(twig);
  }
View Full Code Here

    assertParser(twig);
  }

  @Test
  public void testTwigWithOneDescendant() throws QueryNodeException {
    final QueryBuilder build = new QueryBuilder();
    final TwigQuery twig = build.newTwig()
                                .with(build.newNode("aaa"), 2);
    assertParser(twig);
  }
View Full Code Here

    assertParser(twig);
  }

  @Test
  public void testTwigWithChildAndDescendant() throws QueryNodeException {
    final QueryBuilder build = new QueryBuilder();
    final TwigQuery twig = build.newTwig()
                                .with(build.newNode("aaa"))
                                .without(build.newNode("bbb"), 2)
                                .optional(build.newTwig()
                                               .with(build.newNode("ccc")), 4);
    assertParser(twig);
  }
View Full Code Here

    parser.parse(query, "");
  }

  @Test
  public void testBooleanWithOneClause() throws QueryNodeException {
    final QueryBuilder build = new QueryBuilder();
    final BooleanQuery bool = build.newBoolean()
                                   .with(build.newNode("aaa"));
    assertParser(bool);
  }
View Full Code Here

TOP

Related Classes of org.sindice.siren.qparser.json.dsl.QueryBuilder

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.