01: package com.mockrunner.test.connector;
02:
03: import com.mockrunner.mock.connector.cci.MockResultSetInfo;
04:
05: import junit.framework.TestCase;
06:
07: public class MockResultSetInfoTest extends TestCase {
08: private MockResultSetInfo info;
09:
10: protected void setUp() throws Exception {
11: info = new MockResultSetInfo();
12: }
13:
14: protected void tearDown() throws Exception {
15: info = null;
16: }
17:
18: public void testSetAndGet() throws Exception {
19: info.setInsertsAreDetected(2, false);
20: info.setDeletesAreDetected(3, false);
21: info.setUpdatesAreDetected(4, false);
22: info.setOthersInsertsAreVisible(1, false);
23: info.setOthersDeletesAreVisible(3, false);
24: info.setOthersUpdatesAreVisible(5, false);
25: info.setOwnInsertsAreVisible(2, false);
26: info.setOwnDeletesAreVisible(1, false);
27: info.setOwnUpdatesAreVisible(3, false);
28: info.setSupportsResultSetType(1, false);
29: info.setSupportsResultTypeConcurrency(1, 3, false);
30: info.setSupportsResultTypeConcurrency(1, 2, true);
31: info.setSupportsResultTypeConcurrency(1, 5, false);
32: info.setSupportsResultTypeConcurrency(2, 3, false);
33: info.setSupportsResultTypeConcurrency(2, 2, true);
34: assertFalse(info.insertsAreDetected(2));
35: assertTrue(info.insertsAreDetected(1));
36: assertFalse(info.deletesAreDetected(3));
37: assertTrue(info.deletesAreDetected(2));
38: assertFalse(info.updatesAreDetected(4));
39: assertTrue(info.updatesAreDetected(3));
40: assertFalse(info.othersInsertsAreVisible(1));
41: assertTrue(info.othersInsertsAreVisible(2));
42: assertFalse(info.othersDeletesAreVisible(3));
43: assertTrue(info.othersDeletesAreVisible(4));
44: assertFalse(info.othersUpdatesAreVisible(5));
45: assertTrue(info.othersUpdatesAreVisible(4));
46: assertFalse(info.ownInsertsAreVisible(2));
47: assertTrue(info.ownInsertsAreVisible(1));
48: assertFalse(info.ownDeletesAreVisible(1));
49: assertTrue(info.ownDeletesAreVisible(2));
50: assertFalse(info.ownUpdatesAreVisible(3));
51: assertTrue(info.ownUpdatesAreVisible(2));
52: assertFalse(info.supportsResultSetType(1));
53: assertTrue(info.supportsResultSetType(2));
54: assertFalse(info.supportsResultTypeConcurrency(1, 3));
55: assertFalse(info.supportsResultTypeConcurrency(1, 5));
56: assertFalse(info.supportsResultTypeConcurrency(2, 3));
57: assertTrue(info.supportsResultTypeConcurrency(1, 2));
58: assertTrue(info.supportsResultTypeConcurrency(2, 2));
59: assertTrue(info.supportsResultTypeConcurrency(4, 2));
60: assertTrue(info.supportsResultTypeConcurrency(5, 5));
61: assertTrue(info.supportsResultTypeConcurrency(0, 0));
62: }
63: }
|