File tree Expand file tree Collapse file tree 3 files changed +31
-14
lines changed
de.gebit.integrity.jenkins/src/main/java/de/gebit/integrity Expand file tree Collapse file tree 3 files changed +31
-14
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ public class IntegrityCompoundTestResult extends TabulatedResult {
5252
5353 static {
5454 XSTREAM .alias ("result" , IntegrityCompoundTestResult .class );
55+ XSTREAM .processAnnotations (IntegrityCompoundTestResult .class );
5556 XSTREAM .registerConverter (new HeapSpaceStringConverter (), 100 );
5657 }
5758
Original file line number Diff line number Diff line change 1+ /*******************************************************************************
2+ * Copyright (c) 2022 Rene Schneider, GEBIT Solutions GmbH and others.
3+ * All rights reserved. This program and the accompanying materials
4+ * are made available under the terms of the Eclipse Public License v1.0
5+ * which accompanies this distribution, and is available at
6+ * http://www.eclipse.org/legal/epl-v10.html
7+ *******************************************************************************/
8+ package de .gebit .integrity ;
9+
10+ import hudson .init .InitMilestone ;
11+ import hudson .init .Initializer ;
12+ import hudson .model .Run ;
13+
14+ /**
15+ *
16+ *
17+ * @author Rene Schneider - initial API and implementation
18+ *
19+ */
20+ public class IntegrityPluginInitializer {
21+
22+ @ Initializer (before = InitMilestone .JOB_LOADED )
23+ public static void init () {
24+ // This is important to fix issue #25 (Testresult data serialized into build.xml and integrityResultData.xml)
25+ // Due to JEP-228 (https://github.com/jenkinsci/jep/blob/master/jep/228/README.adoc) the XStream annotations
26+ // used on IntegrityCompoundTestResult do not work automatically anymore and must be manually parsed.
27+ Run .XSTREAM .processAnnotations (IntegrityCompoundTestResult .class );
28+ }
29+
30+ }
Original file line number Diff line number Diff line change 1515import org .kohsuke .stapler .StaplerProxy ;
1616import org .kohsuke .stapler .export .Exported ;
1717
18- import com .thoughtworks .xstream .XStream ;
19-
2018import hudson .model .Action ;
2119import hudson .model .HealthReport ;
2220import hudson .model .Job ;
2321import hudson .model .Run ;
2422import hudson .model .TaskListener ;
2523import hudson .tasks .test .AbstractTestResultAction ;
26- import hudson .util .HeapSpaceStringConverter ;
27- import hudson .util .XStream2 ;
2824import jenkins .tasks .SimpleBuildStep ;
2925
3026/**
@@ -45,16 +41,6 @@ public class IntegrityTestResultAction extends AbstractTestResultAction<Integrit
4541 */
4642 private transient List <IntegrityProjectAction > projectActions ;
4743
48- /**
49- * The XStream instance used for result persistence.
50- */
51- private static final XStream XSTREAM = new XStream2 ();
52-
53- static {
54- XSTREAM .alias ("result" , IntegrityCompoundTestResult .class );
55- XSTREAM .registerConverter (new HeapSpaceStringConverter (), 100 );
56- }
57-
5844 /**
5945 * The action URL part.
6046 */
You can’t perform that action at this time.
0 commit comments