.getCriteria().get(0)).getValue());
cliAction.setQuery("ProductId:TestProductId ProductName:TestProductName");
cliAction.execute(printer);
assertEquals(1, clientSetQuery.getCriteria().size());
BooleanQueryCriteria bqc = (BooleanQueryCriteria) clientSetQuery
.getCriteria().get(0);
assertEquals(2, bqc.getTerms().size());
assertEquals(BooleanQueryCriteria.OR, bqc.getOperator());
assertEquals("ProductId",
((TermQueryCriteria) bqc.getTerms().get(0)).getElementName());
assertEquals("TestProductId",
((TermQueryCriteria) bqc.getTerms().get(0)).getValue());
assertEquals("ProductName",
((TermQueryCriteria) bqc.getTerms().get(1)).getElementName());
assertEquals("TestProductName", ((TermQueryCriteria) bqc.getTerms()
.get(1)).getValue());
cliAction
.setQuery("ProductId:TestProductId NominalDate:[20020101 TO 20030101]");
cliAction.execute(printer);
assertEquals(1, clientSetQuery.getCriteria().size());
bqc = (BooleanQueryCriteria) clientSetQuery.getCriteria().get(0);
assertEquals(2, bqc.getTerms().size());
assertEquals(BooleanQueryCriteria.OR, bqc.getOperator());
assertEquals("ProductId",
((TermQueryCriteria) bqc.getTerms().get(0)).getElementName());
assertEquals("TestProductId",
((TermQueryCriteria) bqc.getTerms().get(0)).getValue());
assertEquals("NominalDate",
((RangeQueryCriteria) bqc.getTerms().get(1)).getElementName());
assertEquals("20020101",
((RangeQueryCriteria) bqc.getTerms().get(1)).getStartValue());
assertEquals("20030101",
((RangeQueryCriteria) bqc.getTerms().get(1)).getEndValue());
assertTrue(((RangeQueryCriteria) bqc.getTerms().get(1)).getInclusive());
cliAction
.setQuery("ProductId:TestProductId NominalDate:{20020101 TO 20030101}");
cliAction.execute(printer);
cliAction.execute(printer);
assertEquals(1, clientSetQuery.getCriteria().size());
bqc = (BooleanQueryCriteria) clientSetQuery.getCriteria().get(0);
assertEquals(2, bqc.getTerms().size());
assertEquals(BooleanQueryCriteria.OR, bqc.getOperator());
assertEquals("ProductId",
((TermQueryCriteria) bqc.getTerms().get(0)).getElementName());
assertEquals("TestProductId",
((TermQueryCriteria) bqc.getTerms().get(0)).getValue());
assertEquals("NominalDate",
((RangeQueryCriteria) bqc.getTerms().get(1)).getElementName());
assertEquals("20020101",
((RangeQueryCriteria) bqc.getTerms().get(1)).getStartValue());
assertEquals("20030101",
((RangeQueryCriteria) bqc.getTerms().get(1)).getEndValue());
assertFalse(((RangeQueryCriteria) bqc.getTerms().get(1)).getInclusive());
cliAction
.setQuery("ProductId:TestProductId AND ProductName:TestProductName");
cliAction.execute(printer);
assertEquals(1, clientSetQuery.getCriteria().size());
bqc = (BooleanQueryCriteria) clientSetQuery.getCriteria().get(0);
assertEquals(2, bqc.getTerms().size());
assertEquals(BooleanQueryCriteria.AND, bqc.getOperator());
assertEquals("ProductId",
((TermQueryCriteria) bqc.getTerms().get(0)).getElementName());
assertEquals("TestProductId",
((TermQueryCriteria) bqc.getTerms().get(0)).getValue());
assertEquals("ProductName",
((TermQueryCriteria) bqc.getTerms().get(1)).getElementName());
assertEquals("TestProductName", ((TermQueryCriteria) bqc.getTerms()
.get(1)).getValue());
cliAction
.setQuery("ProductId:TestProductId OR ProductName:TestProductName");
cliAction.execute(printer);
assertEquals(1, clientSetQuery.getCriteria().size());
bqc = (BooleanQueryCriteria) clientSetQuery.getCriteria().get(0);
assertEquals(2, bqc.getTerms().size());
assertEquals(BooleanQueryCriteria.OR, bqc.getOperator());
assertEquals("ProductId",
((TermQueryCriteria) bqc.getTerms().get(0)).getElementName());
assertEquals("TestProductId",
((TermQueryCriteria) bqc.getTerms().get(0)).getValue());
assertEquals("ProductName",
((TermQueryCriteria) bqc.getTerms().get(1)).getElementName());
assertEquals("TestProductName", ((TermQueryCriteria) bqc.getTerms()
.get(1)).getValue());
cliAction
.setQuery("(ProductId:TestProductId OR ProductName:TestProductName) AND NominalDate:20110120");
cliAction.execute(printer);
assertEquals(1, clientSetQuery.getCriteria().size());
bqc = (BooleanQueryCriteria) clientSetQuery.getCriteria().get(0);
assertEquals(2, bqc.getTerms().size());
assertEquals(BooleanQueryCriteria.AND, bqc.getOperator());
BooleanQueryCriteria subBqc = (BooleanQueryCriteria) bqc.getTerms()
.get(0);
assertEquals("ProductId",
((TermQueryCriteria) subBqc.getTerms().get(0)).getElementName());
assertEquals("TestProductId",
((TermQueryCriteria) subBqc.getTerms().get(0)).getValue());
assertEquals("ProductName",
((TermQueryCriteria) subBqc.getTerms().get(1)).getElementName());
assertEquals("TestProductName", ((TermQueryCriteria) subBqc.getTerms()
.get(1)).getValue());
assertEquals("NominalDate",
((TermQueryCriteria) bqc.getTerms().get(1)).getElementName());
assertEquals("20110120",
((TermQueryCriteria) bqc.getTerms().get(1)).getValue());