ActionQueueState.java

1
package com.renomad.minum.queue;
2
3
import java.util.Queue;
4
import java.util.concurrent.LinkedBlockingQueue;
5
6
/**
7
 * This class tracks the overall state of the {@link ActionQueue}s that
8
 * are in use throughout the system.  We need one central place to
9
 * track these, so that at system shutdown we can close them all cleanly.
10
 * <br>
11
 * As each ActionQueue gets created, it registers itself here.
12
 */
13
public class ActionQueueState {
14
15
    private final Queue<AbstractActionQueue> aqQueue;
16
17
    public ActionQueueState() {
18
        aqQueue = new LinkedBlockingQueue<>();
19
    }
20
21
    public String aqQueueAsString() {
22 1 1. aqQueueAsString : replaced return value with "" for com/renomad/minum/queue/ActionQueueState::aqQueueAsString → TIMED_OUT
        return aqQueue.toString();
23
    }
24
25
    public void offerToQueue(AbstractActionQueue actionQueue) {
26
        aqQueue.offer(actionQueue);
27
    }
28
29
    public AbstractActionQueue pollFromQueue() {
30 1 1. pollFromQueue : replaced return value with null for com/renomad/minum/queue/ActionQueueState::pollFromQueue → KILLED
        return aqQueue.poll();
31
    }
32
33
    public boolean isAqQueueEmpty() {
34 2 1. isAqQueueEmpty : replaced boolean return with true for com/renomad/minum/queue/ActionQueueState::isAqQueueEmpty → KILLED
2. isAqQueueEmpty : replaced boolean return with false for com/renomad/minum/queue/ActionQueueState::isAqQueueEmpty → KILLED
        return aqQueue.isEmpty();
35
    }
36
37
}

Mutations

22

1.1
Location : aqQueueAsString
Killed by : none
replaced return value with "" for com/renomad/minum/queue/ActionQueueState::aqQueueAsString → TIMED_OUT

30

1.1
Location : pollFromQueue
Killed by : com.renomad.minum.utils.ActionQueueKillerTests.test_KillAllQueues_NeedingInterruption(com.renomad.minum.utils.ActionQueueKillerTests)
replaced return value with null for com/renomad/minum/queue/ActionQueueState::pollFromQueue → KILLED

34

1.1
Location : isAqQueueEmpty
Killed by : com.renomad.minum.utils.ActionQueueKillerTests.test_KillAllQueues(com.renomad.minum.utils.ActionQueueKillerTests)
replaced boolean return with true for com/renomad/minum/queue/ActionQueueState::isAqQueueEmpty → KILLED

2.2
Location : isAqQueueEmpty
Killed by : com.renomad.minum.utils.ActionQueueKillerTests.test_KillAllQueues_NeedingInterruption(com.renomad.minum.utils.ActionQueueKillerTests)
replaced boolean return with false for com/renomad/minum/queue/ActionQueueState::isAqQueueEmpty → KILLED

Active mutators

Tests examined


Report generated by PIT 1.17.0