Annotation Interface Verify


@Target({TYPE,METHOD}) @Retention(RUNTIME) @Documented public @interface Verify
Verifies the database after test.

Annotate a test method with @Verify to verify the database after the test method executed. Annotate the whole test class to have all its test methods verify the database. For example:

@Test @Verify
public void myTestMethod {
}

By default, the system locates sequentially the following files in the package of the class, the first file found wins:

  1. <test class name>.<test method name>-verify.xml
  2. <test method name>-verify.xml
  3. <test class name>-verify.xml

Specify the names of files explicitly in the annotation to override the default file name convention. Multiple files may be specified, the system uses all of them. The files are located in the package of the class. For example:

@Test
@Verify({ "custom-verify-1.xml", "custom-verify-2.xml", "custom-verify-3.xml" })
public void myTestMethod {
}

The verification files must conform to the DBunit's "flat XML dataset" format, which means there is a root <dataset /> element, which contains one element for each row, where the name of the row element specifies the database table and its elements specify the table columns. So, for example:

<dataset>
        <person name="Joe" />
</dataset>

System verifies all datasets located against the database.

Use @Verify.List to define multiple @Verify annotations on the same element.

See http://lightair.sourceforge.net/features/verify.html for more info.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Defines several @Verify annotations on the same element.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Name of the profile.
    Names of files with datasets.
  • Element Details

    • value

      String[] value
      Names of files with datasets.
      Returns:
      datasets
      Default:
      {}
    • profile

      String profile
      Name of the profile.

      A profile lets you connect to a different database. A profile must be defined in the LightAir properties file and must have its own properties file which defines the connection to the profile database.

      Returns:
      profile
      Default:
      ""