@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; }
@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()); }
@Test public void testBindingEmpty() throws Exception { final Binding binding = testObj.nextBinding(); assertFalse(binding.isEmpty()); }
private static boolean isNotNeeded(Binding b) { return b.isEmpty(); }