DateTimeUtils.java

1
/*
2
 * Copyright (c) 2015 Maxim Yunusov
3
 *    Licensed under the Apache License, Version 2.0 (the "License");
4
 *    you may not use this file except in compliance with the License.
5
 *    You may obtain a copy of the License at
6
 *
7
 *        http://www.apache.org/licenses/LICENSE-2.0
8
 *
9
 *    Unless required by applicable law or agreed to in writing, software
10
 *    distributed under the License is distributed on an "AS IS" BASIS,
11
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 *    See the License for the specific language governing permissions and
13
 *    limitations under the License.
14
 */
15
16
package org.maxur.perfmodel.backend.utils;
17
18
import java.util.Timer;
19
import java.util.TimerTask;
20
21
/**
22
 * Date Time Utils class.
23
 *
24
 * @author myunusov
25
 * @version 1.0
26
 * @since <pre>01.09.2015</pre>
27
 */
28
public final class DateTimeUtils {
29
30
    private DateTimeUtils() {
31
    }
32
33
    /**
34
     * Postpone operation for delay milliseconds.
35
     * While server sends stop request to client.
36
     *
37
     * @param operation postponed operation.
38
     * @param delay duration of delay to operation.
39
     * @return TimerTask see TimerTask
40
     */
41
    public static TimerTask schedule(final Runnable operation, long delay) {
42
        final Timer timer = new Timer();
43
        final TimerTask task = new TimerTask() {
44
            public void run() {
45 1 1. run : removed call to java/lang/Runnable::run → NO_COVERAGE
                operation.run();
46
            }
47
        };
48 1 1. schedule : removed call to java/util/Timer::schedule → NO_COVERAGE
        timer.schedule(task, delay);
49 1 1. schedule : mutated return of Object value for org/maxur/perfmodel/backend/utils/DateTimeUtils::schedule to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return task;
50
    }
51
}

Mutations

45

1.1
Location : run
Killed by : none
removed call to java/lang/Runnable::run → NO_COVERAGE

48

1.1
Location : schedule
Killed by : none
removed call to java/util/Timer::schedule → NO_COVERAGE

49

1.1
Location : schedule
Killed by : none
mutated return of Object value for org/maxur/perfmodel/backend/utils/DateTimeUtils::schedule to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.1.6