String className = entry.getKey();
TestClassResult result = entry.getValue();
File file = new File(testResultsDir, "TEST-" + className + ".xml");
Writer output = null;
try {
<BUG>output = new BufferedWriter(new FileWriter(file));
saxWriter.write(className, result, output);</BUG>
} catch (IOException e) {
throw new GradleException("Problems writing xml test results to file: " + file, e);
} finally {

String className = entry.getKey();
TestClassResult result = entry.getValue();
File file = new File(testResultsDir, "TEST-" + className + ".xml");
Writer output = null;
try {
output = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(file)), "UTF-8");
saxWriter.write(className, result, output);
} catch (IOException e) {
throw new GradleException("Problems writing xml test results to file: " + file, e);
} finally {
