Yariv_Amar
13 years agoContributor
bug in "Message Content Assetrion" with dates
I have a step that runs JDBC request to query an Oracle table and then validates the result using Message Content Assertion and Xpath.
When I run the step on my machine (win) it works fine, but when it runs from Maven on our Hudson env. I get failure (see logs below).
The problematic field type is (any) date-time, in my example DETECTION_TIME.
the result from the DB is:
<DETECTION_TIME>2012-12-25 11:00:00</DETECTION_TIME>
in Message Content Assertion i wrote the value: 2012-12-25 11:00:00
This fails on our Maven run w/o details on the error (see the log below).
In addition i've added another Xpath Assertion for the same field:
Xpath: //Results[1]/ResultSet[1]/Row[1]/DETECTION_TIME[1]/text()
Value: 2012-12-25 11:00:00
This assertion pass OK.
There are 2 bugs here (to my opinion
)
1. Message Content Assertion for JDBC response does not validate dates properly when run from Maven
2. Message Content Assertion failure message is poor. it should say what was expected and what is the actual value in the logs.
thanks,
here is the relevant part from the log.
2013-01-06 17:19:54,891 INFO [SoapUIProTestCaseRunner] running step [Validate TimeDetection]
2013-01-06 17:19:54,960 INFO [log] this is the result as seen by groovy script:
<ResultSet fetchSize="10">
<Row rowNumber="1">
<ID>b7c8c25c-e385-4bf4-b19b-e874155e2454</ID>
<DETECTION_TIME>2012-12-25 11:00:00</DETECTION_TIME>
<STATUS_TYPE_ENUM>ON</STATUS_TYPE_ENUM>
</Row>
</ResultSet>
2013-01-06 17:19:54,969 INFO [SoapUIProTestCaseRunner] Assertion [JDBC Status] has status VALID
2013-01-06 17:19:54,970 INFO [SoapUIProTestCaseRunner] Assertion [Match content of [DETECTION_TIME]] has status VALID
2013-01-06 17:19:54,971 INFO [SoapUIProTestCaseRunner] Assertion [Message Content Assertion] has status FAILED
2013-01-06 17:19:54,972 ERROR [SoapUIProTestCaseRunner] ASSERTION FAILED -> Message Content Assertion failed : failed/compared = 1/2
2013-01-06 17:19:54,974 ERROR [SoapUIProTestCaseRunner] Validate Edit Detection failed, exporting to [/o.../xxx_path removed_xxx/tion-0-FAILED.txt]
When I run the step on my machine (win) it works fine, but when it runs from Maven on our Hudson env. I get failure (see logs below).
The problematic field type is (any) date-time, in my example DETECTION_TIME.
the result from the DB is:
<DETECTION_TIME>2012-12-25 11:00:00</DETECTION_TIME>
in Message Content Assertion i wrote the value: 2012-12-25 11:00:00
This fails on our Maven run w/o details on the error (see the log below).
In addition i've added another Xpath Assertion for the same field:
Xpath: //Results[1]/ResultSet[1]/Row[1]/DETECTION_TIME[1]/text()
Value: 2012-12-25 11:00:00
This assertion pass OK.
There are 2 bugs here (to my opinion

1. Message Content Assertion for JDBC response does not validate dates properly when run from Maven
2. Message Content Assertion failure message is poor. it should say what was expected and what is the actual value in the logs.
thanks,
here is the relevant part from the log.
2013-01-06 17:19:54,891 INFO [SoapUIProTestCaseRunner] running step [Validate TimeDetection]
2013-01-06 17:19:54,960 INFO [log] this is the result as seen by groovy script:
<ResultSet fetchSize="10">
<Row rowNumber="1">
<ID>b7c8c25c-e385-4bf4-b19b-e874155e2454</ID>
<DETECTION_TIME>2012-12-25 11:00:00</DETECTION_TIME>
<STATUS_TYPE_ENUM>ON</STATUS_TYPE_ENUM>
</Row>
</ResultSet>
2013-01-06 17:19:54,969 INFO [SoapUIProTestCaseRunner] Assertion [JDBC Status] has status VALID
2013-01-06 17:19:54,970 INFO [SoapUIProTestCaseRunner] Assertion [Match content of [DETECTION_TIME]] has status VALID
2013-01-06 17:19:54,971 INFO [SoapUIProTestCaseRunner] Assertion [Message Content Assertion] has status FAILED
2013-01-06 17:19:54,972 ERROR [SoapUIProTestCaseRunner] ASSERTION FAILED -> Message Content Assertion failed : failed/compared = 1/2
2013-01-06 17:19:54,974 ERROR [SoapUIProTestCaseRunner] Validate Edit Detection failed, exporting to [/o.../xxx_path removed_xxx/tion-0-FAILED.txt]