I have a test case where there is a varchar column that is returned inside a cursor and i am expecting a space. basically, what is happening is that the space is being converted to a NULL by XML parsing, but the returned result set has a space. so, a non-equals assertion is fired because NULL!=space.
how can i get the result tag to reflect the fact that spaces are relevant?
thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried that and got the same result. however, i did not look into it thoroughly. i had more pressing things to follow up on. i may have something stupid going on.
i will post back when i get a chance to look more closely.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
secondly, i did something stupid. i finished what i was focused on and came back to the beginning. i think i screwed up the copy/paste of the expected results. having a space in the sqlunit test file works too. i must have had things out of order. the result sets i am using are rather larger and very similar and i guess i thought the rows lined up and didn't.
sorry for wasting bandwidth.
as an aside, are there any utilities that narrow the scope/more precisely report diffs in result set rows? if not, perhaps that will be my first contribution. i am going to need to do that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No problem about the false alarm, I am glad it worked both natively and with CDATA, and thanks for getting back with the results.
As for selective comparison, I think if you do not include the columns you dont want to compare (with the correct row number) in the resultset element, then it will not compare it. Not sure if this is the functionality you are after, but if that is, then its in there already.
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a test case where there is a varchar column that is returned inside a cursor and i am expecting a space. basically, what is happening is that the space is being converted to a NULL by XML parsing, but the returned result set has a space. so, a non-equals assertion is fired because NULL!=space.
how can i get the result tag to reflect the fact that spaces are relevant?
thanks.
Not sure, perhaps make it a CDATA? Would that work?
<result>
...<resultset>
......<row>
.........<col><![CDATA[ ]]></col>
......</row>
...</resultset>
</result>
-sujit
I tried that and got the same result. however, i did not look into it thoroughly. i had more pressing things to follow up on. i may have something stupid going on.
i will post back when i get a chance to look more closely.
ok. false alarm - sorry.
first, yes, CDATA with a space works.
secondly, i did something stupid. i finished what i was focused on and came back to the beginning. i think i screwed up the copy/paste of the expected results. having a space in the sqlunit test file works too. i must have had things out of order. the result sets i am using are rather larger and very similar and i guess i thought the rows lined up and didn't.
sorry for wasting bandwidth.
as an aside, are there any utilities that narrow the scope/more precisely report diffs in result set rows? if not, perhaps that will be my first contribution. i am going to need to do that.
Hi Pat,
No problem about the false alarm, I am glad it worked both natively and with CDATA, and thanks for getting back with the results.
As for selective comparison, I think if you do not include the columns you dont want to compare (with the correct row number) in the resultset element, then it will not compare it. Not sure if this is the functionality you are after, but if that is, then its in there already.
-sujit