示例#1
0
 /**
  * Test of appendQueryBodyToSql method, of class
  * org.mmbase.storage.search.implementation.database.ChainedSqlHandler.
  */
 public void testAppendQueryBodyToSql() throws Exception {
   StringBuilder sb = new StringBuilder();
   instance.appendQueryBodyToSql(sb, query, instance);
   String queryBody = sb.toString();
   sb.setLength(0);
   testSuccessor.appendQueryBodyToSql(sb, query, instance);
   String queryBody2 = sb.toString();
   assertTrue(queryBody.length() > 0);
   assertTrue(queryBody.equals(queryBody2));
 }
示例#2
0
 /**
  * Test of appendConstraintToSql method, of class
  * org.mmbase.storage.search.implementation.database.ChainedSqlHandler.
  */
 public void testAppendConstraintToSql() throws Exception {
   StringBuilder sb = new StringBuilder();
   Constraint constraint = new BasicCompositeConstraint(CompositeConstraint.LOGICAL_AND);
   instance.appendConstraintToSql(sb, constraint, query, false, false);
   String strConstraint = sb.toString();
   sb.setLength(0);
   testSuccessor.appendConstraintToSql(sb, constraint, query, false, false);
   String queryBody2 = sb.toString();
   assertTrue(strConstraint.length() > 0);
   assertTrue(strConstraint.equals(queryBody2));
 }