@Test public void testInsertIteratorUpdate() throws Exception {
Insert command = (Insert)TranslationHelper.helpTranslate(TranslationHelper.BQT_VDB, "insert into BQT1.SmallA (IntKey, IntNum) values (1, 2)"); //$NON-NLS-1$
List<List<Integer>> values = new ArrayList<List<Integer>>();
values.add(Arrays.asList(1, 2));
values.add(Arrays.asList(2, 3));
command.setValueSource(new IteratorValueSource(values.iterator(), 2));
Connection connection = Mockito.mock(Connection.class);
PreparedStatement p = Mockito.mock(PreparedStatement.class);
Mockito.stub(p.executeBatch()).toReturn(new int [] {1, 1});
Mockito.stub(connection.prepareStatement("INSERT INTO SmallA (IntKey, IntNum) VALUES (?, ?)")).toReturn(p); //$NON-NLS-1$