You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Janardhan, Jay" <jj...@rsasecurity.com> on 2007/01/03 19:48:19 UTC

Maven junit-report.xml file parsing

Hello all,

 

I'm new to maven stumbling my way around. I could get maven to compile,
run junit tests and generate junit-report.html file. But my requirement
is that I need to parse the junit results (junit-result.xml) and upload
into a database. 

 

Is there a way I could split-out the junit results data into a plain
text file using maven so that I could load it into a database? 

 

For example: 

 

If my DB table has:

_______________

|     test_cases          |

--------------------------

|  test_case_name   |

|  run_duration        |

|  result                      |

---------------------------

 

My output text file (parsed from junit-result.xml) should look like:

 

testCaseName1             2.43      passed

testCaseName2             1.11      failed

testCaseName3             4.98      passed

 

 

Any suggestions?

 

Appreciate any help.

-Jay

 


Re: Maven junit-report.xml file parsing

Posted by Wayne Fay <wa...@gmail.com>.
I'd just apply an XSLT to the XML file so you get the output you need...

Wa

On 1/3/07, Janardhan, Jay <jj...@rsasecurity.com> wrote:
> Hello all,
>
>
>
> I'm new to maven stumbling my way around. I could get maven to compile,
> run junit tests and generate junit-report.html file. But my requirement
> is that I need to parse the junit results (junit-result.xml) and upload
> into a database.
>
>
>
> Is there a way I could split-out the junit results data into a plain
> text file using maven so that I could load it into a database?
>
>
>
> For example:
>
>
>
> If my DB table has:
>
> _______________
>
> |     test_cases          |
>
> --------------------------
>
> |  test_case_name   |
>
> |  run_duration        |
>
> |  result                      |
>
> ---------------------------
>
>
>
> My output text file (parsed from junit-result.xml) should look like:
>
>
>
> testCaseName1             2.43      passed
>
> testCaseName2             1.11      failed
>
> testCaseName3             4.98      passed
>
>
>
>
>
> Any suggestions?
>
>
>
> Appreciate any help.
>
> -Jay
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org