Junit XML report has empty `<properties/>`

The JUnit XML report (generated by JUnitXmlResultWriter seems to contain an empty <properties/> element. However a similear report generated by maven or ant’s junit runner contains all system properties as returned by System.getProperties(). These properties are useful in diagnosing test failures that may be caused because of system properties that may or may not be set on remote CI machines.

The fix seems to be to add the following lines to org.gradle.api.internal.tasks.testing.junit.result.JUnitXmlResultWriter, however for some reason I’m unable to master gradle to compile on my machine.

            Map<Object, Object> systemProperties = System.getProperties();

            for (Map.Entry<Object, Object> entry : systemProperties.entrySet()) {
                    .attribute("name", (String) entry.getKey())
                    .attribute("value", (String) entry.getValue());

I’m happy to submit a pull request if someone can confirm that this is the right place to apply a fix.

That code could throw a ClassCastException.
I’d probably use String.valueOf(x) instead of (String) x

Thank you for that catch, I’ll fix it.