Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.41</version>
<version>4.44</version>
<relativePath />
</parent>
<artifactId>xcode-plugin</artifactId>
Expand Down Expand Up @@ -146,7 +146,7 @@
<revision>2.0.17</revision>
<changelist>999999-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/xcode-plugin</gitHubRepo>
<jenkins.version>2.319.1</jenkins.version>
<jenkins.version>2.362-SNAPSHOT</jenkins.version>
</properties>
<build>
<plugins>
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/au/com/rayh/XCodeBuildOutputParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import jenkins.util.SetContextClassLoader;

import au.com.rayh.report.TestCase;
import au.com.rayh.report.TestError;
Expand Down Expand Up @@ -176,16 +177,11 @@ private void requireTestCase(String name) {

private void writeTestReport() throws IOException, InterruptedException,
JAXBException {
JAXBContext jaxbContext;
try (SetContextClassLoader sccl = new SetContextClassLoader()) {
jaxbContext = JAXBContext.newInstance(TestSuite.class);
}
try (OutputStream testReportOutputStream = outputForSuite()) {
JAXBContext jaxbContext;
Thread t = Thread.currentThread();
ClassLoader orig = t.getContextClassLoader();
t.setContextClassLoader(XCodeBuildOutputParser.class.getClassLoader());
try {
jaxbContext = JAXBContext.newInstance(TestSuite.class);
} finally {
t.setContextClassLoader(orig);
}
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.marshal(currentTestSuite, testReportOutputStream);
}
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/au/com/rayh/XcodeTestSummariesParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.regex.Pattern;
import java.text.ParseException;
import hudson.FilePath;
import jenkins.util.SetContextClassLoader;

import com.dd.plist.NSDictionary;
import com.dd.plist.NSArray;
Expand Down Expand Up @@ -40,16 +41,11 @@ public XcodeTestSummariesParser(FilePath workspace) throws IOException, Interrup

private void writeTestReport(TestSuite currentTestSuite) throws IOException, InterruptedException,
JAXBException {
JAXBContext jaxbContext;
try (SetContextClassLoader sccl = new SetContextClassLoader()) {
jaxbContext = JAXBContext.newInstance(TestSuite.class);
}
try (OutputStream testReportOutputStream = outputForSuite(currentTestSuite)) {
JAXBContext jaxbContext;
Thread t = Thread.currentThread();
ClassLoader orig = t.getContextClassLoader();
t.setContextClassLoader(XcodeTestSummariesParser.class.getClassLoader());
try {
jaxbContext = JAXBContext.newInstance(TestSuite.class);
} finally {
t.setContextClassLoader(orig);
}
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.marshal(currentTestSuite, testReportOutputStream);
}
Expand Down