Announcement Announcement Module
Collapse
No announcement yet.
Integration Testing errors on lookup tables Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Integration Testing errors on lookup tables

    I am new to this so I might be way off base but I would like to know.

    I have an application that I am building with 17 tables, 3 of which are code tables.
    I am building a script to create the application.
    In the script I have the code/lookup tables defined and then have a few tables that have references to the tables. For example a person must be associated with a supported locale so the Person class has a reference to a SupportedLocale table in a field called "locale". No surprises so far.
    The script compiles in about 77 seconds which is pretty nice and has no errors which is even nicer.
    When I run mvn test, the tests fail and the log says that it is getting security constraint violations when it tries to delete entries from the code tables. The constraints are coming from the other classes/tables rather from the one under test.

    I fixed it by setting notNull to false for any reference to the code tables but that is not really what I would like to do.

    Have I done something wrong and made a mistake on the diagnosis or is there a way to tell the tests that unless you cleanup the database between each test and remove things in the right order, the tests will not work even if the application is correct?

  • #2
    Hi,

    This is a issue with Roo´s test generation, if you look at the generated test code, you will see that Roo generates some data for testing purposes, when there´re composition into the model usually triying to delete a entity throws a IntegrityConstraintViolation, but thre´s nothing wrong with the application but with the test.

    There´s a Jira Issue open, check this thread for more information:

    http://forum.springsource.org/showthread.php?t=74271

    Regards

    Comment

    Working...
    X