• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Writing a JUnit Result XML on Runtime with Ant?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Moosers,

I want to achieve the following:

While running an application on JBoss7, during RunTime I want to not only run JUnit Tests (which I can), but their results shall be exported into an XML file (JUnit.xsd Standard) like Ant does it on Build.
I google a little but I am stuck.

That is the code to simply run the test and display results in the console of Jboss7. Which works perfectly fine.


Now I am trying to use the ANT Api to generate the typical JUnit Result XML, to be able to give it to other tools like Jenkins.



Problems : To be able to cast to JUnitTest, I had to make my HelloWorldSecurityTest extend JUnitTest, which I am not sure was the right thing to do?
And now I got some exceptions like :


I suppose it tries to write the xml ? , and it is missing the libs/jars for the xml model?


[I could write my own "XMLWriter" and based on the Result.java export the data, but that seems to much overhead since Ant is able to that as well?]


Does anyone have a Fix or another approach?

Thanks and Greetings,
Mox.
 
Bernard Sanvoisin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I got a Result.XML as Expected with the following Code:



and I had to Add this to my TestClass



because thís Exception :

and "MethodName not found"

But now I got the Problem that only one test per testclass would be possible ...
therefore I need to build a testsuite ..
Anyone any Ideas ??
Greetings,
Mox.

 
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic