Menu

#64 [PATCH] ReplacementTable - allow fail if value not replaced

closed-accepted
None
5
2008-07-09
2007-03-21
No

I would like DbUnit to allow a fail-fast when a value is marked (delimited) for replacement, but no replacement is found. For example, if I have a value "${test-id}-1" that should get a replacement, but I accidentally added a replacement for "Test-Id" (instead of "test-id") then the value won't get replaced, when I'm expecting it to. The reason for the fail-fast is it makes debugging much easier - the developer can immediately fix the test data, rather than debugging his own code that he thinks is failing.

The solution I put together is very simple, and is backwards compatible. I just added a new property "strictReplacement" to the ReplacementTable and ReplacementDataSet classes. When set to true (default is false), the fail-fast behavior is used.

The patch I submitted includes a test case which I added to ReplacementTableTest.

Discussion

  • Jacob Robertson

    Jacob Robertson - 2007-03-21

    SVN Patch File for ReplacementTable, ReplacementDataSet and ReplacementTableTest

     
  • matthias g

    matthias g - 2008-06-29

    Logged In: YES
    user_id=1803108
    Originator: NO

    From my point of view this feature could also be a 2.3 candidate - it does not imply big changes but looks quite useful to me. +1 for me

     
  • matthias g

    matthias g - 2008-07-02

    Logged In: YES
    user_id=1803108
    Originator: NO

    Committed on trunk rev. 683

     
  • matthias g

    matthias g - 2008-07-09
    • assigned_to: nobody --> gommma
    • status: open --> closed-accepted
     

Log in to post a comment.