Пример #1
0
 @Test
 public void setAutoCommit_table_shouldSucceed() throws SQLException {
   container.setAutoCommit(true);
   assertTrue(container.isAutoCommit());
   container.setAutoCommit(false);
   Assert.assertFalse(container.isAutoCommit());
 }
Пример #2
0
  @Test
  public void itemWithExistingVersionColumnIsRemoved() throws SQLException {
    container.setAutoCommit(true);
    query.setVersionColumn(ID);

    assertTrue(container.removeItem(container.lastItemId()));
  }
Пример #3
0
 @Test
 public void addItem_tableAddOneNewItem_autoCommit_sizeIsIncreased() throws SQLException {
   container.setAutoCommit(true);
   int originalSize = container.size();
   container.addItem();
   assertEquals(originalSize + 1, container.size());
 }
Пример #4
0
 @Test
 public void addItem_tableAddOneNewItem_autoCommit_returnsFinalItemId() throws SQLException {
   container.setAutoCommit(true);
   Object itemId = container.addItem();
   Assert.assertNotNull(itemId);
   assertTrue(itemId instanceof RowId);
   Assert.assertFalse(itemId instanceof TemporaryRowId);
 }
Пример #5
0
  @Test
  public void allIdsFound_table5000RowsLastId_autoCommit_shouldSucceed() throws SQLException {
    DataGenerator.addFiveThousandPeople(connectionPool);

    container.setAutoCommit(true);
    for (int i = 0; i < 5000; i++) {
      assertTrue(container.containsId(container.getIdByIndex(i)));
    }
  }