StandardTable.java

1
package pro.verron.officestamper.core;
2
3
import org.docx4j.wml.Tbl;
4
import pro.verron.officestamper.api.Table;
5
import pro.verron.officestamper.utils.wml.WmlUtils;
6
7
import java.util.List;
8
9
/// The [StandardTable] class represents a table in a document and implements the [Table] interface. It provides
10
/// functionality to manipulate and interact with tables in documents.
11
public class StandardTable
12
        implements Table {
13
    private final Tbl tbl;
14
15
16
    /// Constructs a new [StandardTable] object with the specified [Tbl] object.
17
    ///
18
    /// @param tbl the [Tbl] object representing the table
19
    public StandardTable(Tbl tbl) {
20
        this.tbl = tbl;
21
    }
22
23
    @Override
24
    public void remove() {
25 1 1. remove : removed call to pro/verron/officestamper/utils/wml/WmlUtils::remove → KILLED
        WmlUtils.remove(tbl);
26
    }
27
28
    @Override
29
    public int indexOf(Row row) {
30 1 1. indexOf : replaced int return with 0 for pro/verron/officestamper/core/StandardTable::indexOf → KILLED
        return tbl.getContent()
31
                  .indexOf(row.asTr());
32
    }
33
34
    @Override
35
    public void addAll(int index, List<Row> rows) {
36
        var trs = rows.stream()
37
                      .map(Row::asTr)
38
                      .toList();
39
        tbl.getContent()
40
           .addAll(index, trs);
41
    }
42
43
    @Override
44
    public void add(int index, Row row) {
45
        var tr = row.asTr();
46
        tbl.getContent()
47 1 1. add : removed call to java/util/List::add → KILLED
           .add(index, tr);
48
    }
49
}

Mutations

25

1.1
Location : remove
Killed by : pro.verron.officestamper.test.ProcessorDisplayIfTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorDisplayIfTest]/[test-template:conditionalDisplayOfTableBug32Test(pro.verron.officestamper.test.utils.ContextFactory)]/[test-template-invocation:#2]
removed call to pro/verron/officestamper/utils/wml/WmlUtils::remove → KILLED

30

1.1
Location : indexOf
Killed by : pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[method:test114()]
replaced int return with 0 for pro/verron/officestamper/core/StandardTable::indexOf → KILLED

47

1.1
Location : add
Killed by : pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[method:test114()]
removed call to java/util/List::add → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.0