ChooseAndApplyWeatherAction.java

1
package com.takenoko.actions.weather;
2
3
import com.takenoko.actions.Action;
4
import com.takenoko.actions.ActionResult;
5
import com.takenoko.actions.annotations.ActionAnnotation;
6
import com.takenoko.actions.annotations.ActionType;
7
import com.takenoko.engine.Board;
8
import com.takenoko.engine.BotManager;
9
import com.takenoko.weather.Weather;
10
import java.util.Objects;
11
12
/** Action to choose a weather and apply it. */
13
@ActionAnnotation(ActionType.FORCED)
14
public class ChooseAndApplyWeatherAction implements Action {
15
    final Weather weather;
16
17
    public ChooseAndApplyWeatherAction(Weather weather) {
18
        this.weather = weather;
19
    }
20
21
    @Override
22
    public ActionResult execute(Board board, BotManager botManager) {
23 1 1. execute : removed call to com/takenoko/engine/BotManager::displayMessage → TIMED_OUT
        botManager.displayMessage(botManager.getName() + " chose and applied weather " + weather);
24 1 1. execute : removed call to com/takenoko/stats/SingleBotStatistics::updateWeathersApplied → TIMED_OUT
        botManager.getSingleBotStatistics().updateWeathersApplied(weather.toString());
25 1 1. execute : replaced return value with null for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::execute → KILLED
        return new ActionResult(weather.apply(board, botManager), 0);
26
    }
27
28
    @Override
29
    public boolean equals(Object o) {
30 2 1. equals : negated conditional → SURVIVED
2. equals : replaced boolean return with false for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → NO_COVERAGE
        if (this == o) return true;
31 3 1. equals : replaced boolean return with true for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → NO_COVERAGE
2. equals : negated conditional → KILLED
3. equals : negated conditional → KILLED
        if (o == null || getClass() != o.getClass()) return false;
32
        ChooseAndApplyWeatherAction that = (ChooseAndApplyWeatherAction) o;
33 2 1. equals : replaced boolean return with true for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → SURVIVED
2. equals : replaced boolean return with false for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → KILLED
        return Objects.equals(weather, that.weather);
34
    }
35
36
    @Override
37
    public int hashCode() {
38 1 1. hashCode : replaced int return with 0 for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::hashCode → TIMED_OUT
        return Objects.hash(weather);
39
    }
40
}

Mutations

23

1.1
Location : execute
Killed by : none
removed call to com/takenoko/engine/BotManager::displayMessage → TIMED_OUT

24

1.1
Location : execute
Killed by : none
removed call to com/takenoko/stats/SingleBotStatistics::updateWeathersApplied → TIMED_OUT

25

1.1
Location : execute
Killed by : com.takenoko.actions.weather.ChooseAndApplyWeatherActionTest.[engine:junit-jupiter]/[class:com.takenoko.actions.weather.ChooseAndApplyWeatherActionTest]/[nested-class:TestApply]/[method:shouldReturnAnActionResult()]
replaced return value with null for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::execute → KILLED

30

1.1
Location : equals
Killed by : none
negated conditional → SURVIVED

2.2
Location : equals
Killed by : none
replaced boolean return with false for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → NO_COVERAGE

31

1.1
Location : equals
Killed by : com.takenoko.bot.unitary.SmartChooseAndApplyWeatherTest.[engine:junit-jupiter]/[class:com.takenoko.bot.unitary.SmartChooseAndApplyWeatherTest]/[nested-class:FillAction]/[method:shouldApplySun()]
negated conditional → KILLED

2.2
Location : equals
Killed by : com.takenoko.bot.unitary.SmartChooseAndApplyWeatherTest.[engine:junit-jupiter]/[class:com.takenoko.bot.unitary.SmartChooseAndApplyWeatherTest]/[nested-class:FillAction]/[method:shouldApplySun()]
negated conditional → KILLED

3.3
Location : equals
Killed by : none
replaced boolean return with true for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → NO_COVERAGE

33

1.1
Location : equals
Killed by : com.takenoko.bot.unitary.SmartChooseAndApplyWeatherTest.[engine:junit-jupiter]/[class:com.takenoko.bot.unitary.SmartChooseAndApplyWeatherTest]/[nested-class:FillAction]/[method:shouldApplySun()]
replaced boolean return with false for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → KILLED

2.2
Location : equals
Killed by : none
replaced boolean return with true for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → SURVIVED

38

1.1
Location : hashCode
Killed by : none
replaced int return with 0 for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::hashCode → TIMED_OUT

Active mutators

Tests examined


Report generated by PIT 1.8.0