use of org.gradle.internal.xml.SimpleXmlWriter in project gradle by gradle.
the class IvyXmlModuleDescriptorWriter method write.
@Override
public void write(IvyModulePublishMetadata module, File output) {
try {
output.getParentFile().mkdirs();
OutputStream outputStream = new FileOutputStream(output);
try {
SimpleXmlWriter xmlWriter = new SimpleXmlWriter(outputStream, " ");
writeTo(module, xmlWriter);
xmlWriter.flush();
} finally {
outputStream.close();
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
use of org.gradle.internal.xml.SimpleXmlWriter in project gradle by gradle.
the class DefaultIvyModuleDescriptorWriter method write.
@Override
public void write(IvyModulePublishMetadata module, File output) {
try {
output.getParentFile().mkdirs();
OutputStream outputStream = new FileOutputStream(output);
try {
SimpleXmlWriter xmlWriter = new SimpleXmlWriter(outputStream, " ");
writeTo(module, xmlWriter);
xmlWriter.flush();
} finally {
outputStream.close();
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
use of org.gradle.internal.xml.SimpleXmlWriter in project gradle by gradle.
the class JUnitXmlResultWriter method write.
/**
* @param output The destination, unbuffered
*/
public void write(TestClassResult result, OutputStream output) {
String className = result.getClassName();
long classId = result.getId();
try {
SimpleXmlWriter writer = new SimpleXmlWriter(output, " ");
writer.startElement("testsuite").attribute("name", className).attribute("tests", String.valueOf(result.getTestsCount())).attribute("skipped", String.valueOf(result.getSkippedCount())).attribute("failures", String.valueOf(result.getFailuresCount())).attribute("errors", "0").attribute("timestamp", DateUtils.format(result.getStartTime(), DateUtils.ISO8601_DATETIME_PATTERN)).attribute("hostname", hostName).attribute("time", String.valueOf(result.getDuration() / 1000.0));
writer.startElement("properties");
writer.endElement();
writeTests(writer, result.getResults(), className, classId);
writer.startElement("system-out");
writeOutputs(writer, classId, outputAssociation.equals(TestOutputAssociation.WITH_SUITE), TestOutputEvent.Destination.StdOut);
writer.endElement();
writer.startElement("system-err");
writeOutputs(writer, classId, outputAssociation.equals(TestOutputAssociation.WITH_SUITE), TestOutputEvent.Destination.StdErr);
writer.endElement();
writer.endElement();
} catch (IOException e) {
throw UncheckedException.throwAsUncheckedException(e);
}
}
Aggregations