1 package org.dbunit.database.search;
2
3 import java.sql.SQLException;
4
5 import org.dbunit.database.AbstractImportedAndExportedKeysFilteredByPKsTestCase;
6 import org.dbunit.dataset.DataSetException;
7 import org.dbunit.util.search.SearchException;
8
9
10 public class ImportedAndExportedKeysFilteredByPKsCyclicTest extends AbstractImportedAndExportedKeysFilteredByPKsTestCase {
11
12 public ImportedAndExportedKeysFilteredByPKsCyclicTest(String testName) {
13 super(testName, "hypersonic_cyclic_dataset.sql");
14 }
15 protected int[] setupTablesSizeFixture() {
16 int[] sizes = new int[] { 2, 1, 1 };
17 return sizes;
18 }
19
20 public void testAWithOne() throws DataSetException, SQLException, SearchException {
21 addInput( A, new String[] { A1 } );
22 addOutput( C, new String[] { C1 } );
23 addOutput( B, new String[] { B1 } );
24 addOutput( A, new String[] { A1 } );
25 doIt();
26 }
27
28 public void testAWithTwo() throws DataSetException, SQLException, SearchException {
29 addInput( A, new String[] { A1, A2 } );
30 addOutput( C, new String[] { C1 } );
31 addOutput( B, new String[] { B1 } );
32 addOutput( A, new String[] { A1, A2 } );
33 doIt();
34 }
35
36 public void testAWithTwoInvertedInput() throws DataSetException, SQLException, SearchException {
37 addInput( A, new String[] { A2, A1 } );
38 addOutput( C, new String[] { C1 } );
39 addOutput( B, new String[] { B1 } );
40 addOutput( A, new String[] { A1, A2 } );
41 doIt();
42 }
43
44 public void testAWithTwoInvertedOutput() throws DataSetException, SQLException, SearchException {
45 addInput( A, new String[] { A1, A2 } );
46 addOutput( C, new String[] { C1 } );
47 addOutput( B, new String[] { B1 } );
48 addOutput( A, new String[] { A2, A1 } );
49 doIt();
50 }
51
52 public void testAWithRepeated() throws DataSetException, SQLException, SearchException {
53 addInput( A, new String[] { A1, A2, A2, A1, A1, A1, A2, A2 } );
54 addOutput( C, new String[] { C1 } );
55 addOutput( B, new String[] { B1 } );
56 addOutput( A, new String[] { A2, A1 } );
57 doIt();
58 }
59
60 public void testBWithOne() throws DataSetException, SQLException, SearchException {
61 addInput( B, new String[] { B1 } );
62 addOutput( C, new String[] { C1 } );
63 addOutput( B, new String[] { B1 } );
64 addOutput( A, new String[] { A2, A1 } );
65 doIt();
66 }
67
68 public void testCWithOne() throws DataSetException, SQLException, SearchException {
69 addInput( C, new String[] { C1 } );
70 addOutput( C, new String[] { C1 } );
71 addOutput( B, new String[] { B1 } );
72 addOutput( A, new String[] { A2, A1 } );
73 doIt();
74 }
75
76 }