ControllerConfigLoader.java

1
package com.rox.input;
2
3
import de.gurkenlabs.input4j.ComponentType;
4
import de.gurkenlabs.input4j.InputComponent;
5
import de.gurkenlabs.input4j.InputDevice;
6
import de.gurkenlabs.input4j.InputDevicePlugin;
7
import de.gurkenlabs.input4j.InputDevices;
8
9
import java.awt.event.KeyEvent;
10
import java.io.IOException;
11
import java.io.InputStream;
12
import java.lang.reflect.Field;
13
import java.nio.file.Files;
14
import java.nio.file.Path;
15
import java.util.Collection;
16
import java.util.HashMap;
17
import java.util.List;
18
import java.util.Locale;
19
import java.util.Map;
20
import java.util.Optional;
21
import java.util.Properties;
22
import java.util.function.Supplier;
23
import java.util.logging.Level;
24
import java.util.logging.Logger;
25
import java.util.stream.Collectors;
26
27
/**
28
 * Loads a {@link ControllerConfiguration} from a {@code .properties} file - see
29
 * {@code controllers.properties.example} at the repo root for the format. {@link #load} is the thin
30
 * I/O entry point; {@link #parse(Properties)} is the pure, directly-testable core that does the actual
31
 * interpretation.
32
 */
33
public final class ControllerConfigLoader {
34
    private static final String FOUR_SCORE_ENABLED_KEY = "fourscore.enabled";
35
    private static final int PLAYER_COUNT = 4;
36
    private static final float DEFAULT_AXIS_THRESHOLD = 0.5f;
37
    private static final Logger log = Logger.getLogger(ControllerConfigLoader.class.getName());
38
    /**
39
     * Held so its level sticks (the JDK keeps loggers weakly): input4j logs an INFO line for every input
40
     * device it can't open while looking for gamepads - every keyboard and mouse, unless in the
41
     * {@code input} group.
42
     */
43
    private static final Logger INPUT4J_LOG = Logger.getLogger("de.gurkenlabs.input4j");
44
45
    static {
46
        INPUT4J_LOG.setLevel(Level.WARNING);
47
    }
48
49
    //input4j's own InputComponent.ID.get(String) only finds IDs whose owning component class has
50
    //already been loaded by the JVM (each class registers its constants as a static-initializer side
51
    //effect) - relying on that here would make a config's resolvability depend on incidental
52
    //class-loading order (e.g. which real devices happened to be enumerated first), not the config
53
    //itself. Reading de.gurkenlabs.input4j.components.Button/Axis's own declared fields directly (the
54
    //same reflection approach as resolveKeyCode below, against KeyEvent.VK_*) sidesteps that entirely -
55
    //friendly per-controller-type names (e.g. XInput's "A") are deliberately not included here since
56
    //ID's own equals()/registration logic means only the canonical generic name ever survives anyway.
57
    private static final Map<String, InputComponent.ID> KNOWN_COMPONENTS = loadKnownComponents();
58
59
    private ControllerConfigLoader(){
60
    }
61
62
    private static Map<String, InputComponent.ID> loadKnownComponents(){
63
        final Map<String, InputComponent.ID> components = new HashMap<>();
64
        for (final Class<?> componentClass : List.of(
65
                de.gurkenlabs.input4j.components.Button.class, de.gurkenlabs.input4j.components.Axis.class)){
66
            for (final Field field : componentClass.getFields()){
67
                if (InputComponent.ID.class.isAssignableFrom(field.getType())){
68
                    try {
69
                        final InputComponent.ID id = (InputComponent.ID) field.get(null);
70
                        components.put(id.name, id);
71
                    } catch (IllegalAccessException e){
72
                        throw new IllegalStateException("Could not read input4j component field " + field, e);
73
                    }
74
                }
75
            }
76
        }
77
        return components;
78
    }
79
80
    public static ControllerConfiguration load(final Path path) throws IOException {
81
        final Properties properties = new Properties();
82
        try (InputStream in = Files.newInputStream(path)){
83 1 1. load : removed call to java/util/Properties::load → KILLED
            properties.load(in);
84
        }
85 1 1. load : replaced return value with null for com/rox/input/ControllerConfigLoader::load → KILLED
        return parse(properties);
86
    }
87
88
    public static ControllerConfiguration parse(final Properties properties){
89 1 1. parse : replaced return value with null for com/rox/input/ControllerConfigLoader::parse → KILLED
        return parse(properties, ControllerConfigLoader::availableDevices);
90
    }
91
92
    /**
93
     * Test seam: a fake {@code deviceSupplier} makes {@code source=gamepad} parsing fully testable
94
     * without a real physical gamepad, mirroring how {@code SpeakerAudioOutput} takes a real-line
95
     * seam - matches {@link #availableDevices()}'s own doc for why that's the one genuinely
96
     * hardware-dependent piece of this class.
97
     */
98
    static ControllerConfiguration parse(final Properties properties, final Supplier<Collection<InputDevice>> deviceSupplier){
99
        final boolean fourScoreEnabled = Boolean.parseBoolean(properties.getProperty(FOUR_SCORE_ENABLED_KEY, "false"));
100
        final LazyDevices devices = new LazyDevices(deviceSupplier);
101
        final Controller[] players = new Controller[PLAYER_COUNT];
102 2 1. parse : negated conditional → KILLED
2. parse : changed conditional boundary → KILLED
        for (int i = 0; i < PLAYER_COUNT; i++){
103 1 1. parse : Replaced integer addition with subtraction → KILLED
            players[i] = parsePlayer(properties, i + 1, devices);
104
        }
105 1 1. parse : replaced return value with null for com/rox/input/ControllerConfigLoader::parse → KILLED
        return new ControllerConfiguration(players[0], players[1], players[2], players[3], fourScoreEnabled);
106
    }
107
108
    //the plugin returned by the one real InputDevices.init() call this class ever makes (from
109
    //availableDevices() below) - input4j documents that result as owning real hardware resources
110
    //(open device handles), not something whose device list can just be read and discarded. There is
111
    //no config-reload path in this codebase, so tracking only the single most-recently-opened plugin
112
    //(rather than e.g. a per-ControllerConfiguration handle) is a deliberate, sufficient simplification.
113
    private static volatile InputDevicePlugin activePlugin;
114
115
    /**
116
     * Enumerates real, currently-connected gamepads via input4j.
117
     * <p>
118
     * XXX Mutation coverage expected to have issues here since it deals with real hardware (and CI has
119
     * no gamepad attached) - just accepting it for now, same as {@code SpeakerAudioOutput.openDefaultLine()}.
120
     */
121
    private static Collection<InputDevice> availableDevices(){
122
        final InputDevicePlugin plugin = InputDevices.init();
123
        activePlugin = plugin;
124 2 1. availableDevices : replaced return value with Collections.emptyList for com/rox/input/ControllerConfigLoader::availableDevices → NO_COVERAGE
2. availableDevices : negated conditional → NO_COVERAGE
        return plugin == null ? List.of() : plugin.getAll();
125
    }
126
127
    /**
128
     * Closes the input4j plugin opened by the most recent real gamepad enumeration (a no-op if
129
     * gamepads were never used, or none are currently open) - callers should call this once emulation
130
     * has stopped polling gamepads, mirroring how {@code RomVideoSmokeDemo} already closes its
131
     * {@code SwingVideoOutput} in its own outer {@code finally}.
132
     * <p>
133
     * XXX Mutation coverage expected to have issues here since it deals with real hardware (and CI has
134
     * no gamepad attached) - just accepting it for now, same as {@link #availableDevices()}.
135
     */
136
    public static void closeConnectedGamepads() throws IOException {
137
        final InputDevicePlugin plugin = activePlugin;
138 1 1. closeConnectedGamepads : negated conditional → KILLED
        if (plugin != null){
139
            activePlugin = null;
140 1 1. closeConnectedGamepads : removed call to de/gurkenlabs/input4j/InputDevicePlugin::close → KILLED
            plugin.close();
141
        }
142
    }
143
144
    /** Test seam: lets a test drive {@link #closeConnectedGamepads()}'s "an open plugin gets closed" path with a fake plugin, without ever touching real hardware. */
145
    static void setActivePluginForTesting(final InputDevicePlugin plugin){
146
        activePlugin = plugin;
147
    }
148
149
    /** Only calls {@code deviceSupplier} if some player actually needs a gamepad - not for keyboard/none-only configs. */
150
    private static final class LazyDevices {
151
        private final Supplier<Collection<InputDevice>> source;
152
        private Collection<InputDevice> cached;
153
154
        LazyDevices(final Supplier<Collection<InputDevice>> source){
155
            this.source = source;
156
        }
157
158
        Collection<InputDevice> get(){
159 1 1. get : negated conditional → KILLED
            if (cached == null){
160
                cached = source.get();
161
            }
162 1 1. get : replaced return value with Collections.emptyList for com/rox/input/ControllerConfigLoader$LazyDevices::get → KILLED
            return cached;
163
        }
164
    }
165
166
    private static Controller parsePlayer(final Properties properties, final int playerNumber, final LazyDevices devices){
167
        final String prefix = "player" + playerNumber;
168
        final String source = properties.getProperty(prefix + ".source", "none");
169 1 1. parsePlayer : negated conditional → KILLED
        if ("keyboard".equalsIgnoreCase(source)){
170 1 1. parsePlayer : replaced return value with null for com/rox/input/ControllerConfigLoader::parsePlayer → KILLED
            return new KeyboardController(parseKeyBindings(properties, prefix));
171
        }
172 1 1. parsePlayer : negated conditional → KILLED
        if ("gamepad".equalsIgnoreCase(source)){
173
            //parsed even when the gamepad isn't connected, so a typo isn't hidden until it's plugged in
174
            final Map<Button, GamepadBinding> bindings = parseGamepadBindings(properties, prefix);
175 1 1. parsePlayer : replaced return value with null for com/rox/input/ControllerConfigLoader::parsePlayer → KILLED
            return findDevice(properties, prefix, devices.get())
176 1 1. lambda$parsePlayer$0 : replaced return value with null for com/rox/input/ControllerConfigLoader::lambda$parsePlayer$0 → KILLED
                    .<Controller>map(device -> new GamepadController(device, bindings))
177
                    .orElse(Controller.NONE);
178
        }
179 1 1. parsePlayer : negated conditional → KILLED
        if ("none".equalsIgnoreCase(source)){
180 1 1. parsePlayer : replaced return value with null for com/rox/input/ControllerConfigLoader::parsePlayer → KILLED
            return Controller.NONE;
181
        }
182
        throw new IllegalArgumentException("Unknown controller source '" + source + "' for " + prefix);
183
    }
184
185
    /**
186
     * The configured gamepad, or empty (with a warning) if it isn't connected - that player then starts
187
     * with no controller rather than the emulator failing to start.
188
     *
189
     * @throws IllegalArgumentException for a negative {@code deviceIndex} - a config mistake, not a missing pad
190
     */
191
    private static Optional<InputDevice> findDevice(final Properties properties, final String prefix, final Collection<InputDevice> devices){
192
        final List<InputDevice> deviceList = List.copyOf(devices);
193
        final String nameSubstring = properties.getProperty(prefix + ".gamepad.device");
194 1 1. findDevice : negated conditional → KILLED
        if (nameSubstring != null){
195
            final String needle = nameSubstring.toLowerCase(Locale.ROOT);
196
            final Optional<InputDevice> match = deviceList.stream()
197 2 1. lambda$findDevice$0 : replaced boolean return with false for com/rox/input/ControllerConfigLoader::lambda$findDevice$0 → KILLED
2. lambda$findDevice$0 : replaced boolean return with true for com/rox/input/ControllerConfigLoader::lambda$findDevice$0 → KILLED
                    .filter(d -> d.getDisplayName().toLowerCase(Locale.ROOT).contains(needle))
198
                    .findFirst();
199 1 1. findDevice : negated conditional → KILLED
            if (match.isEmpty()){
200 1 1. findDevice : removed call to com/rox/input/ControllerConfigLoader::warnMissing → KILLED
                warnMissing("No connected gamepad matches '" + nameSubstring + "'", prefix, deviceList);
201
            }
202 1 1. findDevice : replaced return value with Optional.empty for com/rox/input/ControllerConfigLoader::findDevice → KILLED
            return match;
203
        }
204
205
        //no name given - fall back to enumeration order, which is stabler within a single run than
206
        //across runs/OS-reboots, hence name-substring being the recommended, primary option above
207
        final int index = Integer.parseInt(properties.getProperty(prefix + ".gamepad.deviceIndex", "0"));
208 2 1. findDevice : negated conditional → KILLED
2. findDevice : changed conditional boundary → KILLED
        if (index < 0){
209
            throw new IllegalArgumentException("Gamepad deviceIndex " + index + " for " + prefix + " can't be negative");
210
        }
211 2 1. findDevice : changed conditional boundary → KILLED
2. findDevice : negated conditional → KILLED
        if (index >= deviceList.size()){
212 1 1. findDevice : removed call to com/rox/input/ControllerConfigLoader::warnMissing → KILLED
            warnMissing("No connected gamepad at index " + index, prefix, deviceList);
213
            return Optional.empty();
214
        }
215 1 1. findDevice : replaced return value with Optional.empty for com/rox/input/ControllerConfigLoader::findDevice → KILLED
        return Optional.of(deviceList.get(index));
216
    }
217
218
    private static void warnMissing(final String problem, final String prefix, final List<InputDevice> connected){
219 1 1. warnMissing : negated conditional → KILLED
        final String found = connected.isEmpty()
220
                ? "none"
221 1 1. lambda$warnMissing$0 : replaced return value with "" for com/rox/input/ControllerConfigLoader::lambda$warnMissing$0 → KILLED
                : connected.stream().map(d -> "'" + d.getDisplayName() + "'").collect(Collectors.joining(", "));
222
        log.warning(problem + " for " + prefix + " (connected: " + found + ") - starting " + prefix + " with no controller");
223
    }
224
225
    private static Map<Button, GamepadBinding> parseGamepadBindings(final Properties properties, final String prefix){
226
        final Map<Button, GamepadBinding> bindings = new HashMap<>();
227
        for (final Button button : Button.values()){
228
            final String value = properties.getProperty(prefix + ".gamepad." + button.name().toLowerCase(Locale.ROOT));
229 1 1. parseGamepadBindings : negated conditional → KILLED
            if (value != null){
230
                bindings.put(button, resolveGamepadBinding(value, prefix, button));
231
            }
232
        }
233 1 1. parseGamepadBindings : replaced return value with Collections.emptyMap for com/rox/input/ControllerConfigLoader::parseGamepadBindings → KILLED
        return bindings;
234
    }
235
236
    private static GamepadBinding resolveGamepadBinding(final String value, final String prefix, final Button button){
237
        final String[] parts = value.split(":", 2);
238
        final String componentName = parts[0].trim();
239
        final InputComponent.ID componentId = KNOWN_COMPONENTS.get(componentName);
240 1 1. resolveGamepadBinding : negated conditional → KILLED
        if (componentId == null){
241
            throw new IllegalArgumentException(
242
                    "Unknown gamepad component '" + componentName + "' bound to " + button + " for " + prefix);
243
        }
244 1 1. resolveGamepadBinding : negated conditional → KILLED
        if (componentId.type != ComponentType.AXIS){
245 2 1. resolveGamepadBinding : changed conditional boundary → KILLED
2. resolveGamepadBinding : negated conditional → KILLED
            if (parts.length > 1){
246
                throw new IllegalArgumentException(
247
                        "Button component '" + componentName + "' bound to " + button + " for " + prefix
248
                                + " must not have a direction suffix");
249
            }
250 1 1. resolveGamepadBinding : replaced return value with null for com/rox/input/ControllerConfigLoader::resolveGamepadBinding → KILLED
            return new GamepadBinding.ButtonBinding(componentId);
251
        }
252 2 1. resolveGamepadBinding : negated conditional → KILLED
2. resolveGamepadBinding : changed conditional boundary → KILLED
        if (parts.length < 2){
253
            throw new IllegalArgumentException(
254
                    "Axis component '" + componentName + "' bound to " + button + " for " + prefix
255
                            + " needs a direction suffix, e.g. '" + componentName + ":positive'");
256
        }
257
        final boolean positive = switch (parts[1].trim().toLowerCase(Locale.ROOT)) {
258
            case "positive" -> true;
259
            case "negative" -> false;
260
            default -> throw new IllegalArgumentException(
261
                    "Unknown axis direction '" + parts[1] + "' bound to " + button + " for " + prefix
262
                            + " - expected 'positive' or 'negative'");
263
        };
264 1 1. resolveGamepadBinding : replaced return value with null for com/rox/input/ControllerConfigLoader::resolveGamepadBinding → KILLED
        return new GamepadBinding.AxisBinding(componentId, positive, DEFAULT_AXIS_THRESHOLD);
265
    }
266
267
    private static Map<Integer, Button> parseKeyBindings(final Properties properties, final String prefix){
268
        final Map<Integer, Button> bindings = new HashMap<>();
269
        for (final Button button : Button.values()){
270
            final String keyName = properties.getProperty(prefix + ".keyboard." + button.name().toLowerCase());
271 1 1. parseKeyBindings : negated conditional → KILLED
            if (keyName != null){
272
                bindings.put(resolveKeyCode(keyName), button);
273
            }
274
        }
275 1 1. parseKeyBindings : replaced return value with Collections.emptyMap for com/rox/input/ControllerConfigLoader::parseKeyBindings → KILLED
        return bindings;
276
    }
277
278
    private static int resolveKeyCode(final String keyName){
279
        try {
280
            //Locale.ROOT, not the JVM default - a Turkish default locale uppercases "i" to "İ" (dotted
281
            //capital I), which would look up a nonexistent "VK_İ..." field instead of "VK_I..."
282 1 1. resolveKeyCode : replaced int return with 0 for com/rox/input/ControllerConfigLoader::resolveKeyCode → KILLED
            return KeyEvent.class.getField("VK_" + keyName.toUpperCase(Locale.ROOT)).getInt(null);
283
        } catch (NoSuchFieldException | IllegalAccessException e){
284
            throw new IllegalArgumentException(
285
                    "Unknown key name '" + keyName + "' - expected a java.awt.event.KeyEvent.VK_* field name", e);
286
        }
287
    }
288
}

Mutations

83

1.1
Location : load
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:loadReadsAPropertiesFileFromDisk(java.nio.file.Path)]
removed call to java/util/Properties::load → KILLED

85

1.1
Location : load
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:loadReadsAPropertiesFileFromDisk(java.nio.file.Path)]
replaced return value with null for com/rox/input/ControllerConfigLoader::load → KILLED

89

1.1
Location : parse
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:noneSourceIsControllerNone()]
replaced return value with null for com/rox/input/ControllerConfigLoader::parse → KILLED

102

1.1
Location : parse
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:unknownSourceThrows()]
negated conditional → KILLED

2.2
Location : parse
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:noneSourceIsControllerNone()]
changed conditional boundary → KILLED

103

1.1
Location : parse
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:loadReadsAPropertiesFileFromDisk(java.nio.file.Path)]
Replaced integer addition with subtraction → KILLED

105

1.1
Location : parse
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:fourScoreEnabledParsesTrue()]
replaced return value with null for com/rox/input/ControllerConfigLoader::parse → KILLED

124

1.1
Location : availableDevices
Killed by : none
replaced return value with Collections.emptyList for com/rox/input/ControllerConfigLoader::availableDevices → NO_COVERAGE

2.2
Location : availableDevices
Killed by : none
negated conditional → NO_COVERAGE

138

1.1
Location : closeConnectedGamepads
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:closeConnectedGamepadsIsANoOpWhenNoGamepadWasEverOpened()]
negated conditional → KILLED

140

1.1
Location : closeConnectedGamepads
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:closeConnectedGamepadsClosesAnOpenPluginExactlyOnce()]
removed call to de/gurkenlabs/input4j/InputDevicePlugin::close → KILLED

159

1.1
Location : get
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceWithANegativeDeviceIndexThrows()]
negated conditional → KILLED

162

1.1
Location : get
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceWithDeviceIndexExactlyAtTheListSizeWarnsAndStartsThatPlayerWithNoController()]
replaced return value with Collections.emptyList for com/rox/input/ControllerConfigLoader$LazyDevices::get → KILLED

169

1.1
Location : parsePlayer
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:unknownSourceThrows()]
negated conditional → KILLED

170

1.1
Location : parsePlayer
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:loadReadsAPropertiesFileFromDisk(java.nio.file.Path)]
replaced return value with null for com/rox/input/ControllerConfigLoader::parsePlayer → KILLED

172

1.1
Location : parsePlayer
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:unknownSourceThrows()]
negated conditional → KILLED

175

1.1
Location : parsePlayer
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:noGamepadsConnectedAtAllSaysSo()]
replaced return value with null for com/rox/input/ControllerConfigLoader::parsePlayer → KILLED

176

1.1
Location : lambda$parsePlayer$0
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceSelectsDeviceByExplicitIndex()]
replaced return value with null for com/rox/input/ControllerConfigLoader::lambda$parsePlayer$0 → KILLED

179

1.1
Location : parsePlayer
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:fourScoreEnabledParsesTrue()]
negated conditional → KILLED

180

1.1
Location : parsePlayer
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:noneSourceIsControllerNone()]
replaced return value with null for com/rox/input/ControllerConfigLoader::parsePlayer → KILLED

194

1.1
Location : findDevice
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceWithANegativeDeviceIndexThrows()]
negated conditional → KILLED

197

1.1
Location : lambda$findDevice$0
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceSelectsDeviceByNameSubstringCaseInsensitively()]
replaced boolean return with false for com/rox/input/ControllerConfigLoader::lambda$findDevice$0 → KILLED

2.2
Location : lambda$findDevice$0
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceWithNoMatchingDeviceNameWarnsAndStartsThatPlayerWithNoController()]
replaced boolean return with true for com/rox/input/ControllerConfigLoader::lambda$findDevice$0 → KILLED

199

1.1
Location : findDevice
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceWithNoMatchingDeviceNameWarnsAndStartsThatPlayerWithNoController()]
negated conditional → KILLED

200

1.1
Location : findDevice
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceWithNoMatchingDeviceNameWarnsAndStartsThatPlayerWithNoController()]
removed call to com/rox/input/ControllerConfigLoader::warnMissing → KILLED

202

1.1
Location : findDevice
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceSelectsDeviceByNameSubstringCaseInsensitively()]
replaced return value with Optional.empty for com/rox/input/ControllerConfigLoader::findDevice → KILLED

208

1.1
Location : findDevice
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceWithANegativeDeviceIndexThrows()]
negated conditional → KILLED

2.2
Location : findDevice
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:noGamepadsConnectedAtAllSaysSo()]
changed conditional boundary → KILLED

211

1.1
Location : findDevice
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:noGamepadsConnectedAtAllSaysSo()]
changed conditional boundary → KILLED

2.2
Location : findDevice
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:noGamepadsConnectedAtAllSaysSo()]
negated conditional → KILLED

212

1.1
Location : findDevice
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:noGamepadsConnectedAtAllSaysSo()]
removed call to com/rox/input/ControllerConfigLoader::warnMissing → KILLED

215

1.1
Location : findDevice
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceSelectsDeviceByExplicitIndex()]
replaced return value with Optional.empty for com/rox/input/ControllerConfigLoader::findDevice → KILLED

219

1.1
Location : warnMissing
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:noGamepadsConnectedAtAllSaysSo()]
negated conditional → KILLED

221

1.1
Location : lambda$warnMissing$0
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceWithDeviceIndexExactlyAtTheListSizeWarnsAndStartsThatPlayerWithNoController()]
replaced return value with "" for com/rox/input/ControllerConfigLoader::lambda$warnMissing$0 → KILLED

229

1.1
Location : parseGamepadBindings
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:aGamepadBindingTypoIsStillAnErrorWhenTheGamepadIsMissing()]
negated conditional → KILLED

233

1.1
Location : parseGamepadBindings
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceDefaultsToDeviceIndexZeroAndBuildsAWorkingGamepadController()]
replaced return value with Collections.emptyMap for com/rox/input/ControllerConfigLoader::parseGamepadBindings → KILLED

240

1.1
Location : resolveGamepadBinding
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:aGamepadBindingTypoIsStillAnErrorWhenTheGamepadIsMissing()]
negated conditional → KILLED

244

1.1
Location : resolveGamepadBinding
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadButtonBindingWithADirectionSuffixThrows()]
negated conditional → KILLED

245

1.1
Location : resolveGamepadBinding
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadDeviceSupplierIsOnlyCalledOnceAcrossMultipleGamepadPlayers()]
changed conditional boundary → KILLED

2.2
Location : resolveGamepadBinding
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadButtonBindingWithADirectionSuffixThrows()]
negated conditional → KILLED

250

1.1
Location : resolveGamepadBinding
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadSourceSelectsDeviceByExplicitIndex()]
replaced return value with null for com/rox/input/ControllerConfigLoader::resolveGamepadBinding → KILLED

252

1.1
Location : resolveGamepadBinding
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadAxisBindingWithoutADirectionSuffixThrows()]
negated conditional → KILLED

2.2
Location : resolveGamepadBinding
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadAxisBindingWithANegativeDirectionOnlyTriggersOnANegativeValue()]
changed conditional boundary → KILLED

264

1.1
Location : resolveGamepadBinding
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:gamepadAxisBindingWithANegativeDirectionOnlyTriggersOnANegativeValue()]
replaced return value with null for com/rox/input/ControllerConfigLoader::resolveGamepadBinding → KILLED

271

1.1
Location : parseKeyBindings
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:unknownKeyNameThrowsAClearException()]
negated conditional → KILLED

275

1.1
Location : parseKeyBindings
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:keyboardSourceBuildsAWorkingKeyboardControllerFromItsBindings()]
replaced return value with Collections.emptyMap for com/rox/input/ControllerConfigLoader::parseKeyBindings → KILLED

282

1.1
Location : resolveKeyCode
Killed by : com.rox.input.ControllerConfigLoaderTest.[engine:junit-jupiter]/[class:com.rox.input.ControllerConfigLoaderTest]/[method:keyboardSourceBuildsAWorkingKeyboardControllerFromItsBindings()]
replaced int return with 0 for com/rox/input/ControllerConfigLoader::resolveKeyCode → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1