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

Mutations

41

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

56

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:#1]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → KILLED

67

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:#12]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED

84

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:#28]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED

88

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:#2]
negated conditional → KILLED

90

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:#28]
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

92

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:#2]
replaced boolean return with false for pro/verron/officestamper/utils/WmlFactory::worthKeeping → KILLED

104

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

107

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

118

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

129

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

140

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:#28]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED

151

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:#28]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED

163

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:#28]
removed call to org/docx4j/wml/Text::setValue → KILLED

164

1.1
Location : newText
Killed by : pro.verron.officestamper.test.RepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatTableRowTest]/[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

165

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:#28]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newText → KILLED

179

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

190

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:#1]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newParagraph → KILLED

201

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

215

1.1
Location : newComments
Killed by : pro.verron.officestamper.test.RepeatDocPartBadPlaceholderTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatDocPartBadPlaceholderTest]/[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

235

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:#12]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newRun → KILLED

261

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:#12]
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:#12]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newInline → KILLED

280

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:#12]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newDrawing → KILLED

293

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

294

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

295

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:#2]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCommentRangeStart → KILLED

308

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

309

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

310

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:#2]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCommentRangeEnd → KILLED

323

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

324

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

325

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

334

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

343

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

352

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

366

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

367

1.1
Location : newWord
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)]
removed call to org/docx4j/openpackaging/parts/WordprocessingML/CommentsPart::setJaxbElement → KILLED

369

1.1
Location : newWord
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)]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newWord → KILLED

385

1.1
Location : newCommentsPart
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)]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newCommentsPart → KILLED

392

1.1
Location : newComments
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)]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newComments → KILLED

402

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

403

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

404

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:#28]
replaced return value with null for pro/verron/officestamper/utils/WmlFactory::newBr → KILLED

Active mutators

Tests examined


Report generated by PIT 1.20.0