コード例 #1
0
  @Test
  public void testEmptyBinding() throws Exception {

    when(mockQueryResult.getColumnNames()).thenReturn(new String[] {});
    final Binding binding = testObj.nextBinding();
    assertTrue(binding.isEmpty());
  }
コード例 #2
0
 private static boolean isNotNeeded(List<Binding> bindingList) {
   for (Binding binding : bindingList) {
     if (!binding.isEmpty()) {
       return false;
     }
   }
   return true;
 }
コード例 #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());
  }
コード例 #4
0
 @Test
 public void testBindingEmpty() throws Exception {
   final Binding binding = testObj.nextBinding();
   assertFalse(binding.isEmpty());
 }
コード例 #5
0
 private static boolean isNotNeeded(Binding b) {
   return b.isEmpty();
 }