コード例 #1
0
 @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});
 }
コード例 #2
0
 @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"});
 }
コード例 #3
0
 @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"});
 }
コード例 #4
0
  @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);
  }
コード例 #5
0
  @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);
  }
コード例 #6
0
 @Test
 @DataSet("DbunitDifferentColumnsTest-FirstContainsNoAttributes.xml")
 public void testFirstContainsNoAttributes() {
   SqlAssert.assertCountSqlResult("select count(*) from person", dataSource, 0L);
 }