Menu

#418 JUnit data sets - Not failing when looking for NULL, if value is present

v2.6.*
closed-invalid
nobody
None
(not fixed)
5
2018-12-13
2018-12-12
No

Hello. Used both JUnit 4.12 and 4.13-beta-1. Also dbUnit 3.4.2 and 3.4.6 and also xmlunit both 1.3 and 1.6.

Firstly apologies if this is in the wrong place. I am also unsure if this issue is JUnit or dbUnit.

We are creating JUnits and using xml datasets as an expected result following running tests, to ensure data is as expected on our Oracle database.

We are now finding an issue, where if we look for null values in our dataset ([null]), it does not fail if the column we are checking does actually contain a value.

If we specify a value in the data set, which is different to the actual value in the colum, it will fail and tell us the difference.

So the issue is that the data set does not detect if a column has a value it in, when our data set is looking for a NULL value.

In the code snippet below, if there is a value on the table 'TABLE_NAME' in the column 'COLUMN_THREE', it will not throw an error.

<?xml version='1.0' encoding='UTF-8'?>
<dataset xmlns:exap="schema_instance" >

  <exap:TABLE_NAME COLUMN_ONE="1" COLUMN_TWO="STACKSAMUS" COLUMN_THREE="[null]" />  

 </dataset>

Thank you very much for any information or help that can be provided and to all those who have put the work into this framework.

Stacks

Discussion

  • Jeff Jensen

    Jeff Jensen - 2018-12-13

    dbUnit 3.4.2 and 3.4.6

    Those dbUnit versions do not exist. Please verify...

    Firstly apologies if this is in the wrong place. I am also unsure if this issue is JUnit or dbUnit.

    It's not JUnit as it does not use datasets or verify database tables.

    You created this as a bug and it is unknown so far (is probably local config problem). It's better to use the email list for discussion and then create a bug if looks like it.

    if we look for null values in our dataset ([null]), it does not fail if the column we are checking does actually contain a value.

    You posted the dataset but:

    • What is the test?
    • What is the configuration that substitutes "[null]" for another value (ReplacementDataSet)?
    • What is in schema_instance?
     

    Last edit: Jeff Jensen 2018-12-13
  • Jeff Jensen

    Jeff Jensen - 2018-12-13
    • status: open --> pending
     
  • Jamie Oliver

    Jamie Oliver - 2018-12-13

    Hello and thank you for the reply. I have spent a while trying to debug it, and found it lives somehwere inside untils version of dbUnit, from what I understand. I can see we are correctly substituting [null] into an actual NULL, prior to the schema comparator. This also explains the verison discrepancy.

     
    • Jeff Jensen

      Jeff Jensen - 2018-12-13

      Thanks for the update. I'm closing this as appears is not a dbUnit issue. If you find a dbUnit issue, please either create a new bug entry or reopen this one.

       
  • Jeff Jensen

    Jeff Jensen - 2018-12-13
    • status: pending --> closed-invalid
     

Log in to post a comment.

MongoDB Logo MongoDB