fork(3) download
  1. def response = """<Results>
  2. <ResultSet fetchSize="64">
  3. <Row rowNumber="1">
  4. <TW070_VALIDATION.CODE>APP</TW070_VALIDATION.CODE>
  5. <TW070_VALIDATION.VALID_DATA/>
  6. </Row>
  7. <Row rowNumber="2">
  8. <TW070_VALIDATION.CODE>CHI</TW070_VALIDATION.CODE>
  9. <TW070_VALIDATION.VALID_DATA>1</TW070_VALIDATION.VALID_DATA>
  10. </Row>
  11. <Row rowNumber="3">
  12. <TW070_VALIDATION.CODE>DEN</TW070_VALIDATION.CODE>
  13. <TW070_VALIDATION.VALID_DATA>1</TW070_VALIDATION.VALID_DATA>
  14. </Row>
  15. </ResultSet>
  16. </Results>"""
  17.  
  18.  
  19. def expected = [APP: '', CHI: '1', DEN: '1']
  20. def xml = new XmlSlurper().parseText(response)
  21. def actual = xml.'**'.findAll{it.name() == 'Row'}.collectEntries{ [(it.'TW070_VALIDATION.CODE'.text()): it.'TW070_VALIDATION.VALID_DATA'.text() ]}
  22. println actual
  23. assert expected == actual
Success #stdin #stdout 0.97s 4456448KB
stdin
Standard input is empty
stdout
[APP:, CHI:1, DEN:1]