Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7560247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:51:02+00:00 2026-05-30T12:51:02+00:00

I’ve written several XMLUnit tests (that fit in to the JUnit framework) in groovy

  • 0

I’ve written several XMLUnit tests (that fit in to the JUnit framework) in groovy and can execute them easily on the command line as per the groovy doco but I don’t quite understand what else I’ve got to do for it to produce the xml output that is needed by Jenkins/Hudson (or other) to display the pass/fail results (like this) and detailed report of the errors etc (like this). (apologies to image owners)

Currently, my kickoff script is this:

def allSuite = new TestSuite('The XSL Tests')

//looking in package xsltests.rail.*
allSuite.addTest(AllTestSuite.suite("xsltests/rail", "*Tests.groovy")) 

junit.textui.TestRunner.run(allSuite)

and this produces something like this:

Running all XSL Tests...
....
Time: 4.141

OK (4 tests)

How can I make this create a JUnit test report xml file suitable to be read by Jenkins/Hudson?

Do I need to kick off the tests with a different JUnit runner?

I have seen this answer but would like to avoid having to write my own test report output.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:51:04+00:00Added an answer on May 30, 2026 at 12:51 pm

    After a little hackage I have taken Eric Wendelin’s suggestion and gone with Gradle.

    To do this I have moved my groovy unit tests into the requisite directory structure src/test/groovy/, with the supporting resources (input and expected output XML files) going into the /src/test/resources/ directory.

    All required libraries have been configured in the build.gradle file, as described (in its entirety) here:

    apply plugin: 'groovy'
    
    repositories {
        mavenCentral()
    }
    
    dependencies {
        testCompile group: 'junit', name: 'junit', version: '4.+'
    
        groovy module('org.codehaus.groovy:groovy:1.8.2') {
            dependency('asm:asm:3.3.1')
            dependency('antlr:antlr:2.7.7')
            dependency('xmlunit:xmlunit:1.3')
            dependency('xalan:serializer:2.7.1')
            dependency('xalan:xalan:2.7.1')
            dependency('org.bluestemsoftware.open.maven.tparty:xerces-impl:2.9.0')
            dependency('xml-apis:xml-apis:2.0.2')
        }
    }
    
    test {
        jvmArgs '-Xms64m', '-Xmx512m', '-XX:MaxPermSize=128m'
    
        testLogging.showStandardStreams = true //not sure about this one, was in official user guide
    
        outputs.upToDateWhen { false } //makes it run every time even when Gradle thinks it is "Up-To-Date"
    }
    

    This applies the Groovy plugin, sets up to use maven to grab the specified dependencies and then adds some extra values to the built-in “test” task.

    One extra thing in there is the last line which makes Gradle run all of my tests every time and not just the ones it thinks are new/changed, this makes Jenkins play nicely.

    I also created a gradle.properties file to get through the corporate proxy/firewall etc:

    systemProp.http.proxyHost=10.xxx.xxx.xxx
    systemProp.http.proxyPort=8080
    systemProp.http.proxyUser=username
    systemProp.http.proxyPassword=passwd
    

    With this, I’ve created a ‘free-style’ project in Jenkins that polls our Mercurial repo periodically and whenever anyone commits an updated XSL to the repo all the tests will be run.

    One of my original goals was being able to produce the standard Jenkins/Hudson pass/fail graphics and the JUnit reports, which is a success: Pass/Fail with JUnit Reports.

    I hope this helps someone else with similar requirements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.