Java Code Examples for javax.sql.rowset.WebRowSet#getInt()

The following examples show how to use javax.sql.rowset.WebRowSet#getInt() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0010(WebRowSet wrs1) throws Exception {
    FileInputStream fis = new FileInputStream(UPDATED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == COFFEES_ROWS);
    assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 3) {
            assertTrue(wrs1.rowUpdated());
            assertTrue(wrs1.getInt(5) == 21 && wrs1.getInt(6) == 69);
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        } else {
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 2
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0011(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 2;
    int addedRowPK = 15;
    int addedRowPK2 = 20;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 2] = addedRowPK;
    expected[expectedSize - 1] = addedRowPK2;
    FileInputStream fis = new FileInputStream(INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEqualsNoOrder(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 15 || wrs1.getInt(1) == 20) {
            assertTrue(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        } else {
            assertFalse(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        }
    }
    wrs1.close();
}
 
Example 3
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0010(WebRowSet wrs1) throws Exception {
    FileInputStream fis = new FileInputStream(UPDATED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == COFFEES_ROWS);
    assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 3) {
            assertTrue(wrs1.rowUpdated());
            assertTrue(wrs1.getInt(5) == 21 && wrs1.getInt(6) == 69);
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        } else {
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 4
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0011(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 2;
    int addedRowPK = 15;
    int addedRowPK2 = 20;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 2] = addedRowPK;
    expected[expectedSize - 1] = addedRowPK2;
    FileInputStream fis = new FileInputStream(INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEqualsNoOrder(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 15 || wrs1.getInt(1) == 20) {
            assertTrue(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        } else {
            assertFalse(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        }
    }
    wrs1.close();
}
 
Example 5
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0011(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 2;
    int addedRowPK = 15;
    int addedRowPK2 = 20;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 2] = addedRowPK;
    expected[expectedSize - 1] = addedRowPK2;
    FileInputStream fis = new FileInputStream(INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEqualsNoOrder(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 15 || wrs1.getInt(1) == 20) {
            assertTrue(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        } else {
            assertFalse(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        }
    }
    wrs1.close();
}
 
Example 6
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0011(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 2;
    int addedRowPK = 15;
    int addedRowPK2 = 20;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 2] = addedRowPK;
    expected[expectedSize - 1] = addedRowPK2;
    FileInputStream fis = new FileInputStream(INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEqualsNoOrder(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 15 || wrs1.getInt(1) == 20) {
            assertTrue(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        } else {
            assertFalse(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        }
    }
    wrs1.close();
}
 
Example 7
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0010(WebRowSet wrs1) throws Exception {
    FileInputStream fis = new FileInputStream(UPDATED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == COFFEES_ROWS);
    assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 3) {
            assertTrue(wrs1.rowUpdated());
            assertTrue(wrs1.getInt(5) == 21 && wrs1.getInt(6) == 69);
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        } else {
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 8
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0010(WebRowSet wrs1) throws Exception {
    FileInputStream fis = new FileInputStream(UPDATED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == COFFEES_ROWS);
    assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 3) {
            assertTrue(wrs1.rowUpdated());
            assertTrue(wrs1.getInt(5) == 21 && wrs1.getInt(6) == 69);
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        } else {
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 9
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0011(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 2;
    int addedRowPK = 15;
    int addedRowPK2 = 20;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 2] = addedRowPK;
    expected[expectedSize - 1] = addedRowPK2;
    FileInputStream fis = new FileInputStream(INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEqualsNoOrder(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 15 || wrs1.getInt(1) == 20) {
            assertTrue(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        } else {
            assertFalse(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        }
    }
    wrs1.close();
}
 
Example 10
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0011(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 2;
    int addedRowPK = 15;
    int addedRowPK2 = 20;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 2] = addedRowPK;
    expected[expectedSize - 1] = addedRowPK2;
    FileInputStream fis = new FileInputStream(INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEqualsNoOrder(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 15 || wrs1.getInt(1) == 20) {
            assertTrue(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        } else {
            assertFalse(wrs1.rowInserted());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowUpdated());
        }
    }
    wrs1.close();
}
 
Example 11
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0010(WebRowSet wrs1) throws Exception {
    FileInputStream fis = new FileInputStream(UPDATED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == COFFEES_ROWS);
    assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 3) {
            assertTrue(wrs1.rowUpdated());
            assertTrue(wrs1.getInt(5) == 21 && wrs1.getInt(6) == 69);
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        } else {
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 12
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0010(WebRowSet wrs1) throws Exception {
    FileInputStream fis = new FileInputStream(UPDATED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == COFFEES_ROWS);
    assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == 3) {
            assertTrue(wrs1.rowUpdated());
            assertTrue(wrs1.getInt(5) == 21 && wrs1.getInt(6) == 69);
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        } else {
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertFalse(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 13
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0012(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 1;
    int addedRowPK = 100;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 1] = addedRowPK;
    FileInputStream fis = new FileInputStream(UPDATED_INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEquals(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == addedRowPK) {
            // Row that was inserted and updated
            assertTrue(wrs1.rowUpdated());
            assertTrue(
                    wrs1.getBigDecimal(4).equals(BigDecimal.valueOf(12.99))
                    && wrs1.getInt(6) == 125);
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        } else {
            // Remaining rows should only be inserted
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 14
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0012(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 1;
    int addedRowPK = 100;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 1] = addedRowPK;
    FileInputStream fis = new FileInputStream(UPDATED_INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEquals(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == addedRowPK) {
            // Row that was inserted and updated
            assertTrue(wrs1.rowUpdated());
            assertTrue(
                    wrs1.getBigDecimal(4).equals(BigDecimal.valueOf(12.99))
                    && wrs1.getInt(6) == 125);
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        } else {
            // Remaining rows should only be inserted
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 15
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0012(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 1;
    int addedRowPK = 100;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 1] = addedRowPK;
    FileInputStream fis = new FileInputStream(UPDATED_INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEquals(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == addedRowPK) {
            // Row that was inserted and updated
            assertTrue(wrs1.rowUpdated());
            assertTrue(
                    wrs1.getBigDecimal(4).equals(BigDecimal.valueOf(12.99))
                    && wrs1.getInt(6) == 125);
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        } else {
            // Remaining rows should only be inserted
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 16
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0012(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 1;
    int addedRowPK = 100;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 1] = addedRowPK;
    FileInputStream fis = new FileInputStream(UPDATED_INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEquals(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == addedRowPK) {
            // Row that was inserted and updated
            assertTrue(wrs1.rowUpdated());
            assertTrue(
                    wrs1.getBigDecimal(4).equals(BigDecimal.valueOf(12.99))
                    && wrs1.getInt(6) == 125);
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        } else {
            // Remaining rows should only be inserted
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 17
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0012(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 1;
    int addedRowPK = 100;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 1] = addedRowPK;
    FileInputStream fis = new FileInputStream(UPDATED_INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEquals(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == addedRowPK) {
            // Row that was inserted and updated
            assertTrue(wrs1.rowUpdated());
            assertTrue(
                    wrs1.getBigDecimal(4).equals(BigDecimal.valueOf(12.99))
                    && wrs1.getInt(6) == 125);
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        } else {
            // Remaining rows should only be inserted
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 18
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0012(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 1;
    int addedRowPK = 100;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 1] = addedRowPK;
    FileInputStream fis = new FileInputStream(UPDATED_INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEquals(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == addedRowPK) {
            // Row that was inserted and updated
            assertTrue(wrs1.rowUpdated());
            assertTrue(
                    wrs1.getBigDecimal(4).equals(BigDecimal.valueOf(12.99))
                    && wrs1.getInt(6) == 125);
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        } else {
            // Remaining rows should only be inserted
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 19
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0012(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 1;
    int addedRowPK = 100;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 1] = addedRowPK;
    FileInputStream fis = new FileInputStream(UPDATED_INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEquals(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == addedRowPK) {
            // Row that was inserted and updated
            assertTrue(wrs1.rowUpdated());
            assertTrue(
                    wrs1.getBigDecimal(4).equals(BigDecimal.valueOf(12.99))
                    && wrs1.getInt(6) == 125);
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        } else {
            // Remaining rows should only be inserted
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        }
    }
    wrs1.close();
}
 
Example 20
@Test(dataProvider = "rowSetType")
public void WebRowSetTest0012(WebRowSet wrs1) throws Exception {
    int expectedSize = COFFEES_ROWS + 1;
    int addedRowPK = 100;
    Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize);
    expected[expectedSize - 1] = addedRowPK;
    FileInputStream fis = new FileInputStream(UPDATED_INSERTED_COFFEE_ROWS_XML);
    wrs1.readXml(fis);
    assertTrue(wrs1.size() == expectedSize);
    assertEquals(getPrimaryKeys(wrs1), expected);
    wrs1.beforeFirst();
    while (wrs1.next()) {
        if (wrs1.getInt(1) == addedRowPK) {
            // Row that was inserted and updated
            assertTrue(wrs1.rowUpdated());
            assertTrue(
                    wrs1.getBigDecimal(4).equals(BigDecimal.valueOf(12.99))
                    && wrs1.getInt(6) == 125);
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        } else {
            // Remaining rows should only be inserted
            assertFalse(wrs1.rowUpdated());
            assertFalse(wrs1.rowDeleted());
            assertTrue(wrs1.rowInserted());
        }
    }
    wrs1.close();
}