SimpleBean.java

1
package mock.context;
2
3
import java.util.Date;
4
5
import ogham.testing.org.apache.commons.lang3.builder.EqualsBuilder;
6
import ogham.testing.org.apache.commons.lang3.builder.HashCodeBuilder;
7
8
public class SimpleBean {
9
	private String name;
10
11
	private int value;
12
13
	private Date date;
14
15
	public SimpleBean(String name, int value, Date date) {
16
		super();
17
		this.name = name;
18
		this.value = value;
19
		this.date = date;
20
	}
21
22
	public SimpleBean(String name, int value) {
23
		this(name, value, null);
24
	}
25
26
	public String getName() {
27 1 1. getName : replaced return value with "" for mock/context/SimpleBean::getName → RUN_ERROR
		return name;
28
	}
29
30
	public void setName(String name) {
31
		this.name = name;
32
	}
33
34
	public int getValue() {
35 1 1. getValue : replaced int return with 0 for mock/context/SimpleBean::getValue → RUN_ERROR
		return value;
36
	}
37
38
	public void setValue(int value) {
39
		this.value = value;
40
	}
41
42
	public Date getDate() {
43 1 1. getDate : replaced return value with null for mock/context/SimpleBean::getDate → RUN_ERROR
		return date;
44
	}
45
46
	public void setDate(Date date) {
47
		this.date = date;
48
	}
49
50
	@Override
51
	public String toString() {
52
		StringBuilder builder = new StringBuilder();
53
		builder.append("{\"name\": \"").append(name).append("\", \"value\": ").append(value).append(", \"date\": \"").append(date).append("\"}");
54 1 1. toString : replaced return value with "" for mock/context/SimpleBean::toString → RUN_ERROR
		return builder.toString();
55
	}
56
57
	@Override
58
	public boolean equals(Object obj) {
59 1 1. equals : negated conditional → RUN_ERROR
		if (obj == null) {
60 1 1. equals : replaced boolean return with true for mock/context/SimpleBean::equals → NO_COVERAGE
			return false;
61
		}
62 1 1. equals : negated conditional → RUN_ERROR
		if (obj == this) {
63 1 1. equals : replaced boolean return with false for mock/context/SimpleBean::equals → NO_COVERAGE
			return true;
64
		}
65 1 1. equals : negated conditional → RUN_ERROR
		if (obj.getClass() != getClass()) {
66 1 1. equals : replaced boolean return with true for mock/context/SimpleBean::equals → NO_COVERAGE
			return false;
67
		}
68
		SimpleBean rhs = (SimpleBean) obj;
69 2 1. equals : replaced boolean return with true for mock/context/SimpleBean::equals → RUN_ERROR
2. equals : replaced boolean return with false for mock/context/SimpleBean::equals → RUN_ERROR
		return new EqualsBuilder().append(name, rhs.name).append(value, rhs.value).append(date, rhs.date).isEquals();
70
	}
71
72
	@Override
73
	public int hashCode() {
74 1 1. hashCode : replaced int return with 0 for mock/context/SimpleBean::hashCode → NO_COVERAGE
		return new HashCodeBuilder().append(name).append(value).append(date).hashCode();
75
	}
76
}

Mutations

27

1.1
Location : getName
Killed by :
replaced return value with "" for mock/context/SimpleBean::getName → RUN_ERROR

35

1.1
Location : getValue
Killed by :
replaced int return with 0 for mock/context/SimpleBean::getValue → RUN_ERROR

43

1.1
Location : getDate
Killed by :
replaced return value with null for mock/context/SimpleBean::getDate → RUN_ERROR

54

1.1
Location : toString
Killed by :
replaced return value with "" for mock/context/SimpleBean::toString → RUN_ERROR

59

1.1
Location : equals
Killed by :
negated conditional → RUN_ERROR

60

1.1
Location : equals
Killed by :
replaced boolean return with true for mock/context/SimpleBean::equals → NO_COVERAGE

62

1.1
Location : equals
Killed by :
negated conditional → RUN_ERROR

63

1.1
Location : equals
Killed by :
replaced boolean return with false for mock/context/SimpleBean::equals → NO_COVERAGE

65

1.1
Location : equals
Killed by :
negated conditional → RUN_ERROR

66

1.1
Location : equals
Killed by :
replaced boolean return with true for mock/context/SimpleBean::equals → NO_COVERAGE

69

1.1
Location : equals
Killed by :
replaced boolean return with true for mock/context/SimpleBean::equals → RUN_ERROR

2.2
Location : equals
Killed by :
replaced boolean return with false for mock/context/SimpleBean::equals → RUN_ERROR

74

1.1
Location : hashCode
Killed by :
replaced int return with 0 for mock/context/SimpleBean::hashCode → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.13.1