Example #1
0
  @Test
  public void testEmptyBinding() throws Exception {

    when(mockQueryResult.getColumnNames()).thenReturn(new String[] {});
    final Binding binding = testObj.nextBinding();
    assertTrue(binding.isEmpty());
  }
 private static boolean isNotNeeded(List<Binding> bindingList) {
   for (Binding binding : bindingList) {
     if (!binding.isEmpty()) {
       return false;
     }
   }
   return true;
 }
Example #3
0
  @Test
  public void testBindingVars() throws Exception {
    final Binding binding = testObj.nextBinding();
    final List<String> vars =
        ImmutableList.copyOf(
            Iterators.transform(
                binding.vars(),
                new Function<Var, String>() {
                  @Override
                  public String apply(final Var var) {
                    return var.getVarName();
                  }
                }));

    assertArrayEquals(columnNames, vars.toArray());
    assertFalse(binding.isEmpty());
  }
Example #4
0
 @Test
 public void testBindingEmpty() throws Exception {
   final Binding binding = testObj.nextBinding();
   assertFalse(binding.isEmpty());
 }
 private static boolean isNotNeeded(Binding b) {
   return b.isEmpty();
 }