@Test @DataSet("DbunitDifferentColumnsTest-FirstContainsMoreAttributes.xml") public void testFirstContainsMoreAttributes() { SqlAssert.assertCountSqlResult("select count(*) from person", dataSource, 2l); SqlAssert.assertMultipleRowSqlResult( "select * from person", dataSource, new String[] {"2", "Myrthe"}, new String[] {"1", null}); }
@Test @DataSet("DbunitDifferentColumnsTest-FirstContainsLessAttributes.xml") public void testFirstContainsLessAttributes() { SqlAssert.assertCountSqlResult("select count(*) from person", dataSource, 2l); SqlAssert.assertSingleRowSqlResult( "select personname from person where personid='1'", dataSource, new String[] {"Willemijn"}); // SqlAssert.assertMultipleRowSqlResult("select * from person", new String[]{"2"}, new // String[]{"1", "Willemijn"}); }
@Test @DataSet("DbunitDifferentColumnsTest-FirstContainsSameAttributes.xml") public void testFirstContainsSameAttributes() { SqlAssert.assertCountSqlResult("select count(*) from person", dataSource, 2l); SqlAssert.assertMultipleRowSqlResult( "select * from person", dataSource, new String[] {"3", "Maurits"}, new String[] {"4", "Franciscus"}); }
@Test @DataSet({ "DbunitDifferentCollumnsTest-WithAllColumns.xml", "DbunitDifferentCollumnsTest-WithOnlyOneColumn.xml" }) public void testFirstDataSetContainsMoreAttributes() { SqlAssert.assertCountSqlResult("select count(*) from person", dataSource, 4L); String[][] expected = new String[][] { new String[] {"12", "Peter"}, new String[] {"13", "Stijn"}, new String[] {"14", null}, new String[] {"15", null} }; SqlAssert.assertMultipleRowSqlResult("select * from person", expected); }
@Test @DataSets({ @DataSet("DbunitDifferentCollumnsTest-WithOnlyOneColumn.xml"), @DataSet("DbunitDifferentCollumnsTest-WithOnlyPersonName.xml") }) public void testFirstDataSetContainsDifferentColumnsThanSecondWithDataSetsAnnotation() { SqlAssert.assertCountSqlResult("select count(*) from person", dataSource, 4L); String[][] expected = new String[][] { new String[] {null, "Suzan"}, new String[] {null, "Mathias"}, new String[] {"14", null}, new String[] {"15", null} }; SqlAssert.assertMultipleRowSqlResult("select * from person", expected); }
@Test @DataSet("DbunitDifferentColumnsTest-FirstContainsNoAttributes.xml") public void testFirstContainsNoAttributes() { SqlAssert.assertCountSqlResult("select count(*) from person", dataSource, 0L); }