@Test public void testThatPrintingDoesntThrowExceptions() { pm.currentTransaction().commit(); pm.currentTransaction().begin(); ZooClassDef def = getDef(TestClass.class); QueryParser qp = new QueryParser("(_int > 1 && _int < 52) || _int > 50", def, null, null); QueryTreeNode qtn = qp.parseQuery(); assertNotNull(qtn.print()); }
private void checkAdvices(String queryFilter, int nAdv) { pm.currentTransaction().commit(); pm.currentTransaction().begin(); ZooClassDef def = getDef(TestClass.class); QueryParser qp = new QueryParser(queryFilter, def, null, null); QueryTreeNode qtn = qp.parseQuery(); QueryOptimizer qo = new QueryOptimizer(def); // no indexing List<QueryAdvice> advices = qo.determineIndexToUse(qtn); // for (QueryAdvice a: advices) { // System.out.println("adv: min/max = " + a.getMin()+"/"+a.getMax()+" cls=" + // a.getIndex());//.getName()); // } assertEquals(nAdv, advices.size()); }