}
@Test
public void testRangeQueries()
throws Exception {
NodeQuery q = new NodeTermRangeQuery(SirenTestCase.DEFAULT_TEST_FIELD,
new BytesRef("a"), new BytesRef("b"), true, true);
this._assertSirenQuery(new LuceneProxyNodeQuery(q), "[ a TO b ]");
q = new NodeTermRangeQuery(SirenTestCase.DEFAULT_TEST_FIELD,
new BytesRef("a"), new BytesRef("b"), false, true);
this._assertSirenQuery(new LuceneProxyNodeQuery(q), "{ a TO b ]");
q = new NodeTermRangeQuery(SirenTestCase.DEFAULT_TEST_FIELD,
new BytesRef("a"), new BytesRef("b"), true, false);
this._assertSirenQuery(new LuceneProxyNodeQuery(q), "[ a TO b }");
q = new NodeTermRangeQuery(SirenTestCase.DEFAULT_TEST_FIELD,
new BytesRef("a"), new BytesRef("b"), false, false);
this._assertSirenQuery(new LuceneProxyNodeQuery(q), "{ a TO b }");
final TwigQuery twq1 = new TwigQuery(1);
twq1.addChild(q, NodeBooleanClause.Occur.MUST);
// TODO parsing the output of #toString of twq1 is not possible because of GH-52
assertEquals(new LuceneProxyNodeQuery(twq1), this.parse(null, "* : { a TO b }"));
final TwigQuery twq2 = new TwigQuery(1);
twq2.addChild(new NodeTermRangeQuery(SirenTestCase.DEFAULT_TEST_FIELD,
new BytesRef("a"), new BytesRef("b"), true, true), NodeBooleanClause.Occur.MUST);
twq2.addChild(q, NodeBooleanClause.Occur.MUST);
assertEquals(new LuceneProxyNodeQuery(twq2), this.parse(null, "* : [ [ a TO b ], { a TO b } ]"));
}