Search in sources :

Example 1 with TestRowSetListener

use of util.TestRowSetListener in project jdk8u_jdk by JetBrains.

the class CommonCachedRowSetTests method commonCachedRowSetTest0008.

/*
     * Create a RowSetListener and validate that notifyRowChanged  and
     * notifyCursorMoved are  called
     */
@Test(dataProvider = "rowsetUsingCoffeeHouses")
public void commonCachedRowSetTest0008(CachedRowSet rs) throws Exception {
    TestRowSetListener rsl = new TestRowSetListener();
    rs.addRowSetListener(rsl);
    rs.first();
    assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED));
    rs.deleteRow();
    assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED | TestRowSetListener.CURSOR_MOVED));
    rsl.resetFlag();
    rs.setShowDeleted(true);
    rs.undoDelete();
    assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
    rs.close();
}
Also used : TestRowSetListener(util.TestRowSetListener) Test(org.testng.annotations.Test)

Example 2 with TestRowSetListener

use of util.TestRowSetListener in project jdk8u_jdk by JetBrains.

the class CommonCachedRowSetTests method commonCachedRowSetTest0005.

/*
     * Create a RowSetListener and validate that notifyRowSetChanged is called
     */
@Test(dataProvider = "rowSetType")
public void commonCachedRowSetTest0005(CachedRowSet rs) throws Exception {
    TestRowSetListener rsl = new TestRowSetListener();
    rs.addRowSetListener(rsl);
    rs.restoreOriginal();
    assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
    rs.close();
}
Also used : TestRowSetListener(util.TestRowSetListener) Test(org.testng.annotations.Test)

Example 3 with TestRowSetListener

use of util.TestRowSetListener in project jdk8u_jdk by JetBrains.

the class CommonCachedRowSetTests method commonCachedRowSetTest0007.

/*
     * Create a multiple RowSetListeners and validate that notifyRowChanged,
     * notifiyMoved is called on all listners
     */
@Test(dataProvider = "rowsetUsingCoffeeHouses")
public void commonCachedRowSetTest0007(RowSet rs) throws Exception {
    TestRowSetListener rsl = new TestRowSetListener();
    TestRowSetListener rsl2 = new TestRowSetListener();
    rs.addRowSetListener(rsl);
    rs.addRowSetListener(rsl2);
    rs.first();
    rs.updateInt(1, 1961);
    rs.updateString(2, "Pittsburgh");
    rs.updateInt(3, 1987);
    rs.updateInt(4, 2341);
    rs.updateInt(5, 6689);
    rs.updateRow();
    assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED | TestRowSetListener.ROW_CHANGED));
    assertTrue(rsl2.isNotified(TestRowSetListener.CURSOR_MOVED | TestRowSetListener.ROW_CHANGED));
    rs.close();
}
Also used : TestRowSetListener(util.TestRowSetListener) Test(org.testng.annotations.Test)

Example 4 with TestRowSetListener

use of util.TestRowSetListener in project jdk8u_jdk by JetBrains.

the class CommonCachedRowSetTests method commonCachedRowSetTest0006.

/*
     * Create a RowSetListener and validate that notifyRowChanged is called
     */
@Test(dataProvider = "rowsetUsingCoffeeHouses")
public void commonCachedRowSetTest0006(RowSet rs) throws Exception {
    TestRowSetListener rsl = new TestRowSetListener();
    rs.addRowSetListener(rsl);
    rs.moveToInsertRow();
    rs.updateInt(1, 10024);
    rs.updateString(2, "Sacramento");
    rs.updateInt(3, 1987);
    rs.updateInt(4, 2341);
    rs.updateInt(5, 4328);
    rs.insertRow();
    assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
    rs.close();
}
Also used : TestRowSetListener(util.TestRowSetListener) Test(org.testng.annotations.Test)

Example 5 with TestRowSetListener

use of util.TestRowSetListener in project jdk8u_jdk by JetBrains.

the class BaseRowSetTests method baseRowSetTest0005.

/*
     * Create multiple RowSetListeners and validate that notifyCursorMoved
     * is called on all listeners
     */
@Test(dataProvider = "rowSetType")
public void baseRowSetTest0005(StubBaseRowSet rs) throws Exception {
    TestRowSetListener rsl = new TestRowSetListener();
    TestRowSetListener rsl2 = new TestRowSetListener();
    rs.addRowSetListener(rsl);
    rs.addRowSetListener(rsl2);
    rs.notifyCursorMoved();
    assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED));
    assertTrue(rsl2.isNotified(TestRowSetListener.CURSOR_MOVED));
}
Also used : TestRowSetListener(util.TestRowSetListener) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)18 TestRowSetListener (util.TestRowSetListener)18 CachedRowSet (javax.sql.rowset.CachedRowSet)3