Example #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));
 }
Example #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));
 }
Example #3
0
 /**
  * Test of toSql method, of class
  * org.mmbase.storage.search.implementation.database.ChainedSqlHandler.
  */
 public void testToSql() throws Exception {
   String sql = instance.toSql(query, instance);
   assertTrue(sql != null);
   assertTrue(sql.equals(testSuccessor.toSql(query, instance)));
 }
Example #4
0
 /**
  * Test of getAllowedValue method, of class
  * org.mmbase.storage.search.implementation.database.ChainedSqlHandler.
  */
 public void testGetAllowedValue() {
   String result = instance.getAllowedValue(TEST);
   assertTrue(result.length() > 0);
   assertTrue(result.equals(testSuccessor.getAllowedValue(TEST)));
 }