WmlFactory.java

1
package pro.verron.officestamper.utils;
2
3
import org.docx4j.dml.wordprocessingDrawing.Inline;
4
import org.docx4j.openpackaging.exceptions.InvalidFormatException;
5
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
6
import org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage;
7
import org.docx4j.openpackaging.parts.WordprocessingML.CommentsPart;
8
import org.docx4j.wml.*;
9
import org.springframework.lang.Nullable;
10
import pro.verron.officestamper.api.OfficeStamperException;
11
12
import java.math.BigInteger;
13
import java.util.ArrayList;
14
import java.util.Arrays;
15
import java.util.List;
16
import java.util.Random;
17
18
import static java.util.stream.Collectors.toCollection;
19
20
/// Utility class for creating and configuring various WordML (WML) elements.
21
/// Provides static methods to generate paragraphs, runs, comments, text, and other WML structures.
22
/// This is intended for handling Office Open XML documents programmatically.
23
public class WmlFactory {
24
    private static final Random RANDOM = new Random();
25
26
    private WmlFactory() {
27
        throw new OfficeStamperException("Utility class");
28
    }
29
30
    /// Creates a new paragraph containing a single drawing element.
31
    ///
32
    /// @param drawing The Drawing object to be included in the new paragraph.
33
    ///
34
    /// @return A new paragraph containing the provided drawing encapsulated in a run.
35
    public static P newParagraph(Drawing drawing) {
36 1 1. newParagraph : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → NO_COVERAGE
        return newParagraph(List.of(newRun(drawing)));
37
    }
38
39
    /// Creates a new paragraph containing the provided list of values.
40
    ///
41
    /// @param values A list of objects to be added to the new paragraph.
42
    ///               These objects populate the content of the paragraph.
43
    ///
44
    /// @return A new paragraph containing the provided values.
45
    public static P newParagraph(List<?> values) {
46
        var paragraph = new P();
47
        var paragraphContent = paragraph.getContent();
48
        paragraphContent.addAll(values);
49 1 1. newParagraph : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → KILLED
        return paragraph;
50
    }
51
52
    /// Creates a new run containing a single drawing.
53
    ///
54
    /// @param value The Drawing object to be included in the new run.
55
    ///
56
    /// @return A new run encapsulating the provided drawing.
57
    public static R newRun(Drawing value) {
58 1 1. newRun : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED
        return newRun(List.of(value));
59
    }
60
61
    /// Creates a new run containing the provided values deemed worth keeping.
62
    ///
63
    /// @param values A list of objects to be added to the new run.
64
    ///               Objects are filtered based on a predefined criteria to determine if they are worth keeping.
65
    ///
66
    /// @return A new run containing the filtered values.
67
    public static R newRun(List<Object> values) {
68
        var run = new R();
69
        var runContent = run.getContent();
70
        runContent.addAll(values.stream()
71
                                .filter(WmlFactory::worthKeeping)
72
                                .collect(toCollection(ArrayList::new)));
73 1 1. newRun : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED
        return run;
74
    }
75
76
    private static boolean worthKeeping(Object o) {
77 1 1. worthKeeping : negated conditional → KILLED
        if (o instanceof Text text) {
78
            var value = text.getValue();
79 2 1. worthKeeping : replaced boolean return with true for pro/verron/officestamper/utils/WmlFactory::worthKeeping → SURVIVED
2. worthKeeping : negated conditional → KILLED
            return !value.isEmpty();
80
        }
81 1 1. worthKeeping : replaced boolean return with false for pro/verron/officestamper/utils/WmlFactory::worthKeeping → KILLED
        return true;
82
    }
83
84
    /// Creates a new comment with the provided value.
85
    ///
86
    /// @param id    The id to affect to the comment.
87
    /// @param value The string value to be included in the comment.
88
    ///
89
    /// @return A new Comments.Comment object containing the provided value.
90
    public static Comments.Comment newComment(BigInteger id, String value) {
91
        var comment = new Comments.Comment();
92 1 1. newComment : removed call to org/docx4j/wml/Comments$Comment::setId → KILLED
        comment.setId(id);
93
        var commentContent = comment.getContent();
94
        commentContent.add(newParagraph(value));
95 1 1. newComment : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newComment → KILLED
        return comment;
96
    }
97
98
    /// Creates a new paragraph containing the provided string value.
99
    ///
100
    /// @param value The string value to be added to the new paragraph.
101
    ///
102
    /// @return A new paragraph containing the provided string value.
103
    public static P newParagraph(String value) {
104 1 1. newParagraph : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → KILLED
        return newParagraph(newRun(value));
105
    }
106
107
    /// Creates a new paragraph containing the provided run.
108
    ///
109
    /// @param run The R object (run) to be included in the new paragraph.
110
    ///
111
    /// @return A new paragraph containing the provided run.
112
    public static P newParagraph(R run) {
113 1 1. newParagraph : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → KILLED
        return newParagraph(List.of(run));
114
    }
115
116
    /// Creates a new run containing the provided string value.
117
    ///
118
    /// @param value The string value to be included in the new run.
119
    ///
120
    /// @return A new run containing the provided string value.
121
    public static R newRun(String value) {
122 1 1. newRun : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED
        return newRun(newText(value));
123
    }
124
125
    /// Creates a new run containing a single text object.
126
    ///
127
    /// @param value The Text object to be included in the new run.
128
    ///
129
    /// @return A new run encapsulating the provided text object.
130
    public static R newRun(Text value) {
131 1 1. newRun : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED
        return newRun(List.of(value));
132
    }
133
134
    /// Creates a new Text object with the specified value, preserving spaces.
135
    ///
136
    /// @param value The string value to be set in the new Text object.
137
    ///
138
    /// @return A new Text object containing the provided value with space preserved.
139
    public static Text newText(String value) {
140
        var text = new Text();
141 1 1. newText : removed call to org/docx4j/wml/Text::setValue → KILLED
        text.setValue(value);
142 1 1. newText : removed call to org/docx4j/wml/Text::setSpace → KILLED
        text.setSpace("preserve");
143 1 1. newText : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newText → KILLED
        return text;
144
    }
145
146
    /// Creates a new Body object containing the provided elements.
147
    ///
148
    /// @param elements A list of objects to be added to the new Body.
149
    ///
150
    /// @return A new Body containing the provided elements.
151
    public static Body newBody(List<Object> elements) {
152
        Body body = new Body();
153
        var bodyContent = body.getContent();
154
        bodyContent.addAll(elements);
155 1 1. newBody : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newBody → KILLED
        return body;
156
    }
157
158
    /// Creates a new paragraph containing the provided text values.
159
    ///
160
    /// @param texts The array of string values to be included in the new paragraph.
161
    ///
162
    /// @return A new paragraph containing the provided text values.
163
    public static P newParagraph(String... texts) {
164 1 1. newParagraph : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → KILLED
        return newParagraph(Arrays.stream(texts)
165
                                  .map(WmlFactory::newRun)
166
                                  .toList());
167
    }
168
169
    /// Creates a new PPr (paragraph properties) object.
170
    ///
171
    /// @return A new PPr object.
172
    public static PPr newPPr() {
173 1 1. newPPr : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newPPr → KILLED
        return new PPr();
174
    }
175
176
    /// Creates a new Comments object and populates it with a list of Comment objects.
177
    ///
178
    /// @param list A list of Comments.Comment objects to be added to the new Comments object.
179
    ///
180
    /// @return A new Comments object containing the provided Comment objects.
181
    public static Comments newComments(List<Comments.Comment> list) {
182
        Comments comments = new Comments();
183
        List<Comments.Comment> commentList = comments.getComment();
184
        commentList.addAll(list);
185 1 1. newComments : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newComments → KILLED
        return comments;
186
    }
187
188
    /// Creates a new run containing an image with the specified attributes.
189
    ///
190
    /// @param maxWidth      the maximum width of the image, it can be null
191
    /// @param abstractImage the binary part abstract image to be included in the run
192
    /// @param filenameHint  the filename hint for the image
193
    /// @param altText       the alternative text for the image
194
    ///
195
    /// @return a new run element containing the image
196
    public static R newRun(
197
            @Nullable Integer maxWidth,
198
            BinaryPartAbstractImage abstractImage,
199
            String filenameHint,
200
            String altText
201
    ) {
202
        var inline = newInline(abstractImage, filenameHint, altText, maxWidth);
203 1 1. newRun : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED
        return newRun(newDrawing(inline));
204
    }
205
206
    /// Creates a new Inline object for the given image part, filename hint, and alt text.
207
    ///
208
    /// @param imagePart    The binary part abstract image to be used.
209
    /// @param filenameHint A hint for the filename of the image.
210
    /// @param altText      Alternative text for the image.
211
    /// @param maxWidth     The image width to not exceeds, in point.
212
    ///
213
    /// @return A new Inline object containing the specified image information.
214
    ///
215
    /// @throws OfficeStamperException If there is an error creating the image inline.
216
    public static Inline newInline(
217
            BinaryPartAbstractImage imagePart,
218
            String filenameHint,
219
            String altText,
220
            @Nullable Integer maxWidth
221
    ) {
222
        // creating random ids assuming they are unique,
223
        // id must not be too large
224
        // otherwise Word cannot open the document
225
        var id1 = RANDOM.nextLong(100_000L);
226
        var id2 = RANDOM.nextInt(100_000);
227
        try {
228 2 1. newInline : negated conditional → KILLED
2. newInline : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newInline → KILLED
            return maxWidth == null
229
                    ? imagePart.createImageInline(filenameHint, altText, id1, id2, false)
230
                    : imagePart.createImageInline(filenameHint, altText, id1, id2, false, maxWidth);
231
        } catch (Exception e) {
232
            throw new OfficeStamperException(e);
233
        }
234
    }
235
236
    /// Creates a new Drawing object containing the provided Inline object.
237
    ///
238
    /// @param inline The Inline object to be contained within the new Drawing.
239
    ///
240
    /// @return A new Drawing object encapsulating the provided inline object.
241
    public static Drawing newDrawing(Inline inline) {
242
        var drawing = new Drawing();
243
        var anchorOrInline = drawing.getAnchorOrInline();
244
        anchorOrInline.add(inline);
245 1 1. newDrawing : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newDrawing → KILLED
        return drawing;
246
    }
247
248
    /// Creates a new CommentRangeStart object with the specified ID and parent.
249
    ///
250
    /// @param id     The unique identifier for the CommentRangeStart object.
251
    /// @param parent The parent element (P) to which this CommentRangeStart belongs.
252
    ///
253
    /// @return A new CommentRangeStart object with the specified ID and parent.
254
    public static CommentRangeStart newCommentRangeStart(BigInteger id, P parent) {
255
        var commentRangeStart = new CommentRangeStart();
256 1 1. newCommentRangeStart : removed call to org/docx4j/wml/CommentRangeStart::setId → SURVIVED
        commentRangeStart.setId(id);
257 1 1. newCommentRangeStart : removed call to org/docx4j/wml/CommentRangeStart::setParent → SURVIVED
        commentRangeStart.setParent(parent);
258 1 1. newCommentRangeStart : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCommentRangeStart → KILLED
        return commentRangeStart;
259
    }
260
261
    /// Creates a new CommentRangeEnd object with the specified ID and parent.
262
    ///
263
    /// @param id     The unique identifier for the CommentRangeEnd object.
264
    /// @param parent The parent element (P) to which this CommentRangeEnd belongs.
265
    ///
266
    /// @return A new CommentRangeEnd object with the specified ID and parent.
267
    public static CommentRangeEnd newCommentRangeEnd(BigInteger id, P parent) {
268
        var commentRangeEnd = new CommentRangeEnd();
269 1 1. newCommentRangeEnd : removed call to org/docx4j/wml/CommentRangeEnd::setId → SURVIVED
        commentRangeEnd.setId(id);
270 1 1. newCommentRangeEnd : removed call to org/docx4j/wml/CommentRangeEnd::setParent → SURVIVED
        commentRangeEnd.setParent(parent);
271 1 1. newCommentRangeEnd : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCommentRangeEnd → KILLED
        return commentRangeEnd;
272
    }
273
274
    /// Creates a new CommentReference object with the specified ID and parent.
275
    ///
276
    /// @param id     The unique identifier for the CommentReference.
277
    /// @param parent The parent element (P) to which this CommentReference belongs.
278
    ///
279
    /// @return A new CommentReference object with the specified ID and parent.
280
    public static R.CommentReference newCommentReference(BigInteger id, P parent) {
281
        var commentReference = new R.CommentReference();
282 1 1. newCommentReference : removed call to org/docx4j/wml/R$CommentReference::setId → SURVIVED
        commentReference.setId(id);
283 1 1. newCommentReference : removed call to org/docx4j/wml/R$CommentReference::setParent → SURVIVED
        commentReference.setParent(parent);
284 1 1. newCommentReference : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCommentReference → SURVIVED
        return commentReference;
285
    }
286
287
    /// Creates a new table object.
288
    ///
289
    /// @return A new instance of Tbl.
290
    public static Tbl newTbl() {
291 1 1. newTbl : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newTbl → KILLED
        return new Tbl();
292
    }
293
294
    /// Creates a new cell object.
295
    ///
296
    /// @return A new instance of Tc.
297
    public static Tc newCell() {
298 1 1. newCell : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCell → KILLED
        return new Tc();
299
    }
300
301
    /// Creates a new row object.
302
    ///
303
    /// @return A new instance of Tr.
304
    public static Tr newRow() {
305 1 1. newRow : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRow → KILLED
        return new Tr();
306
    }
307
308
    /// Creates a new WordprocessingMLPackage object initialized with a main document part,
309
    /// and an empty comments part.
310
    ///
311
    /// @return A new instance of WordprocessingMLPackage.
312
    public static WordprocessingMLPackage newWord() {
313
        try {
314
            var aPackage = WordprocessingMLPackage.createPackage();
315
            var mainDocumentPart = aPackage.getMainDocumentPart();
316
            var cp = newCommentsPart();
317 1 1. newWord : removed call to org/docx4j/openpackaging/parts/WordprocessingML/CommentsPart::init → SURVIVED
            cp.init();
318 1 1. newWord : removed call to org/docx4j/openpackaging/parts/WordprocessingML/CommentsPart::setJaxbElement → KILLED
            cp.setJaxbElement(newComments());
319
            mainDocumentPart.addTargetPart(cp);
320 1 1. newWord : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newWord → KILLED
            return aPackage;
321
        } catch (InvalidFormatException e) {
322
            throw new OfficeStamperException(e);
323
        }
324
    }
325
326
    /// Creates a new CommentsPart object.
327
    /// This method attempts to create a new instance of CommentsPart.
328
    /// If an InvalidFormatException occurs during the creation process, it wraps the exception in an
329
    /// OfficeStamperException and throws it.
330
    ///
331
    /// @return A new instance of CommentsPart.
332
    public static CommentsPart newCommentsPart() {
333
        try {
334 1 1. newCommentsPart : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCommentsPart → KILLED
            return new CommentsPart();
335
        } catch (InvalidFormatException e) {
336
            throw new OfficeStamperException(e);
337
        }
338
    }
339
340
    private static Comments newComments() {
341 1 1. newComments : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newComments → KILLED
        return new Comments();
342
    }
343
344
    /// Creates a new Br (break) object with text wrapping enabled.
345
    ///
346
    /// @return A new Br object with text wrapping type and no clear attribute set.
347
    public static Br newBr() {
348
        var br = new Br();
349 1 1. newBr : removed call to org/docx4j/wml/Br::setType → SURVIVED
        br.setType(STBrType.TEXT_WRAPPING);
350 1 1. newBr : removed call to org/docx4j/wml/Br::setClear → SURVIVED
        br.setClear(null);
351 1 1. newBr : replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newBr → KILLED
        return br;
352
    }
353
}

Mutations

36

1.1
Location : newParagraph
Killed by : none
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → NO_COVERAGE

49

1.1
Location : newParagraph
Killed by : pro.verron.officestamper.test.ProcessorDisplayIfTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorDisplayIfTest]/[test-template:conditionalDisplayOfParagraphsTest_inlineProcessorExpressionsAreResolved(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → KILLED

58

1.1
Location : newRun
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#30]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED

73

1.1
Location : newRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#13]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED

77

1.1
Location : worthKeeping
Killed by : pro.verron.officestamper.test.WhitespaceTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.WhitespaceTest]/[test-template:should_preserve_tabulations(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
negated conditional → KILLED

79

1.1
Location : worthKeeping
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#12]
negated conditional → KILLED

2.2
Location : worthKeeping
Killed by : none
replaced boolean return with true for pro/verron/officestamper/utils/WmlFactory::worthKeeping → SURVIVED
Covering tests

81

1.1
Location : worthKeeping
Killed by : pro.verron.officestamper.test.WhitespaceTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.WhitespaceTest]/[test-template:should_preserve_tabulations(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
replaced boolean return with false for pro/verron/officestamper/utils/WmlFactory::worthKeeping → KILLED

92

1.1
Location : newComment
Killed by : pro.verron.officestamper.test.ProcessorRepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatParagraphTest]/[method:shouldAcceptSet()]
removed call to org/docx4j/wml/Comments$Comment::setId → KILLED

95

1.1
Location : newComment
Killed by : pro.verron.officestamper.test.ProcessorRepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatParagraphTest]/[method:shouldAcceptSet()]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newComment → KILLED

104

1.1
Location : newParagraph
Killed by : pro.verron.officestamper.test.StampTableTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.StampTableTest]/[test-template:stampTableTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → KILLED

113

1.1
Location : newParagraph
Killed by : pro.verron.officestamper.test.StampTableTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.StampTableTest]/[test-template:stampTableTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → KILLED

122

1.1
Location : newRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#13]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED

131

1.1
Location : newRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#13]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED

141

1.1
Location : newText
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#13]
removed call to org/docx4j/wml/Text::setValue → KILLED

142

1.1
Location : newText
Killed by : pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#3]
removed call to org/docx4j/wml/Text::setSpace → KILLED

143

1.1
Location : newText
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#13]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newText → KILLED

155

1.1
Location : newBody
Killed by : pro.verron.officestamper.test.ProcessorRepeatDocPart_BadPlaceholderTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatDocPart_BadPlaceholderTest]/[test-template:testBadExpressionShouldNotBlockCallerThread(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newBody → KILLED

164

1.1
Location : newParagraph
Killed by : pro.verron.officestamper.test.ProcessorDisplayIfTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorDisplayIfTest]/[test-template:conditionalDisplayOfParagraphsTest_inlineProcessorExpressionsAreResolved(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → KILLED

173

1.1
Location : newPPr
Killed by : pro.verron.officestamper.test.ProcessorRepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatParagraphTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#3]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newPPr → KILLED

185

1.1
Location : newComments
Killed by : pro.verron.officestamper.test.ProcessorRepeatDocPart_BadPlaceholderTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatDocPart_BadPlaceholderTest]/[test-template:testBadExpressionShouldNotBlockCallerThread(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newComments → KILLED

203

1.1
Location : newRun
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#30]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED

228

1.1
Location : newInline
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#30]
negated conditional → KILLED

2.2
Location : newInline
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#30]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newInline → KILLED

245

1.1
Location : newDrawing
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#30]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newDrawing → KILLED

256

1.1
Location : newCommentRangeStart
Killed by : none
removed call to org/docx4j/wml/CommentRangeStart::setId → SURVIVED
Covering tests

257

1.1
Location : newCommentRangeStart
Killed by : none
removed call to org/docx4j/wml/CommentRangeStart::setParent → SURVIVED
Covering tests

258

1.1
Location : newCommentRangeStart
Killed by : pro.verron.officestamper.test.SpelInjectionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.SpelInjectionTest]/[test-template:spelInjectionTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCommentRangeStart → KILLED

269

1.1
Location : newCommentRangeEnd
Killed by : none
removed call to org/docx4j/wml/CommentRangeEnd::setId → SURVIVED
Covering tests

270

1.1
Location : newCommentRangeEnd
Killed by : none
removed call to org/docx4j/wml/CommentRangeEnd::setParent → SURVIVED
Covering tests

271

1.1
Location : newCommentRangeEnd
Killed by : pro.verron.officestamper.test.SpelInjectionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.SpelInjectionTest]/[test-template:spelInjectionTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCommentRangeEnd → KILLED

282

1.1
Location : newCommentReference
Killed by : none
removed call to org/docx4j/wml/R$CommentReference::setId → SURVIVED
Covering tests

283

1.1
Location : newCommentReference
Killed by : none
removed call to org/docx4j/wml/R$CommentReference::setParent → SURVIVED
Covering tests

284

1.1
Location : newCommentReference
Killed by : none
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCommentReference → SURVIVED
Covering tests

291

1.1
Location : newTbl
Killed by : pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[method:shouldAcceptList()]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newTbl → KILLED

298

1.1
Location : newCell
Killed by : pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[method:shouldAcceptList()]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCell → KILLED

305

1.1
Location : newRow
Killed by : pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[method:shouldAcceptList()]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRow → KILLED

317

1.1
Location : newWord
Killed by : none
removed call to org/docx4j/openpackaging/parts/WordprocessingML/CommentsPart::init → SURVIVED
Covering tests

318

1.1
Location : newWord
Killed by : pro.verron.officestamper.test.WhitespaceTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.WhitespaceTest]/[test-template:should_preserve_spaces(pro.verron.officestamper.test.ContextFactory, java.lang.String, java.lang.String)]/[test-template-invocation:#1]
removed call to org/docx4j/openpackaging/parts/WordprocessingML/CommentsPart::setJaxbElement → KILLED

320

1.1
Location : newWord
Killed by : pro.verron.officestamper.test.WhitespaceTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.WhitespaceTest]/[test-template:should_preserve_spaces(pro.verron.officestamper.test.ContextFactory, java.lang.String, java.lang.String)]/[test-template-invocation:#1]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newWord → KILLED

334

1.1
Location : newCommentsPart
Killed by : pro.verron.officestamper.test.WhitespaceTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.WhitespaceTest]/[test-template:should_preserve_spaces(pro.verron.officestamper.test.ContextFactory, java.lang.String, java.lang.String)]/[test-template-invocation:#1]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCommentsPart → KILLED

341

1.1
Location : newComments
Killed by : pro.verron.officestamper.test.WhitespaceTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.WhitespaceTest]/[test-template:should_preserve_spaces(pro.verron.officestamper.test.ContextFactory, java.lang.String, java.lang.String)]/[test-template-invocation:#1]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newComments → KILLED

349

1.1
Location : newBr
Killed by : none
removed call to org/docx4j/wml/Br::setType → SURVIVED
Covering tests

350

1.1
Location : newBr
Killed by : none
removed call to org/docx4j/wml/Br::setClear → SURVIVED
Covering tests

351

1.1
Location : newBr
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#13]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newBr → KILLED

Active mutators

Tests examined


Report generated by PIT 1.21.0