Column.java

1
/*******************************************************************************
2
 * Copyhacked (H) 2012-2020.
3
 * This program and the accompanying materials
4
 * are made available under no term at all, use it like
5
 * you want, but share and discuss about it
6
 * every time possible with every body.
7
 * 
8
 * Contributors:
9
 *      ron190 at ymail dot com - initial implementation
10
 ******************************************************************************/
11
package com.jsql.model.bean.database;
12
13
/**
14
 * Define a Column, e.g. is sent to the view by the model after injection.
15
 * Allow to traverse upward to its corresponding table
16
 */
17
public class Column extends AbstractElementDatabase {
18
    
19
    /**
20
     * The table that contains the current column.
21
     */
22
    private final Table parentTable;
23
24
    /**
25
     * Define the column label and parent table.
26
     * @param newColumnName
27
     * @param newTableName
28
     */
29
    public Column(String newColumnName, Table newTableName) {
30
        
31
        this.elementValue = newColumnName;
32
        this.parentTable = newTableName;
33
    }
34
35
    /**
36
     * Return the parent table.
37
     * @return Parent for column
38
     */
39
    @Override
40
    public AbstractElementDatabase getParent() {
41 1 1. getParent : replaced return value with null for com/jsql/model/bean/database/Column::getParent → KILLED
        return this.parentTable;
42
    }
43
44
    /**
45
     * Default 0, a column doesn't contain anything.
46
     * @return No child for column
47
     */
48
    @Override
49
    public int getChildCount() {
50
        return 0;
51
    }
52
53
    /**
54
     * A readable label for column is its own label.
55
     * @return column text
56
     */
57
    @Override
58
    public String getLabelCount() {
59 1 1. getLabelCount : replaced return value with "" for com/jsql/model/bean/database/Column::getLabelCount → KILLED
        return this.toString();
60
    }
61
}
62

Mutations

41

1.1
Location : getParent
Killed by : BeanDatabaseSpock.[engine:spock]/[spec:BeanDatabaseSpock]/[feature:$spock_feature_0_0]/[iteration:0]
replaced return value with null for com/jsql/model/bean/database/Column::getParent → KILLED

59

1.1
Location : getLabelCount
Killed by : BeanDatabaseSpock.[engine:spock]/[spec:BeanDatabaseSpock]/[feature:$spock_feature_0_0]/[iteration:0]
replaced return value with "" for com/jsql/model/bean/database/Column::getLabelCount → KILLED

Active mutators

Tests examined


Report generated by PIT 1.16.1