ActionCheckIP.java

1
package com.jsql.view.swing.action;
2
3
import com.jsql.util.GitUtil.ShowOnConsole;
4
import com.jsql.util.I18nUtil;
5
import com.jsql.util.LogLevelUtil;
6
import com.jsql.view.swing.util.MediatorHelper;
7
import org.apache.logging.log4j.LogManager;
8
import org.apache.logging.log4j.Logger;
9
10
import java.awt.event.ActionEvent;
11
import java.awt.event.ActionListener;
12
13
/**
14
 * Action performing a IP localization test.
15
 */
16
public class ActionCheckIP implements ActionListener, Runnable {
17
    
18
    /**
19
     * Log4j logger sent to view.
20
     */
21
    private static final Logger LOGGER = LogManager.getRootLogger();
22
23
    @Override
24
    public void actionPerformed(ActionEvent e) {
25 1 1. actionPerformed : removed call to java/lang/Thread::start → NO_COVERAGE
        new Thread(this, "ThreadCheckIP").start();
26
    }
27
28
    @Override
29
    public void run() {
30
        
31 1 1. run : negated conditional → NO_COVERAGE
        if (MediatorHelper.model().getMediatorUtils().getProxyUtil().isNotLive(ShowOnConsole.YES)) {
32
            return;
33
        }
34
35
        LOGGER.log(LogLevelUtil.CONSOLE_DEFAULT, () -> I18nUtil.valueByKey("LOG_IP_ADDRESS_CHECK"));
36
        String addressIp = MediatorHelper.model().getMediatorUtils().getConnectionUtil().getSource("http://checkip.amazonaws.com");
37
        LOGGER.log(
38
            LogLevelUtil.CONSOLE_INFORM,
39
            "{} {}",
40 1 1. lambda$run$1 : replaced return value with null for com/jsql/view/swing/action/ActionCheckIP::lambda$run$1 → NO_COVERAGE
            () -> I18nUtil.valueByKey("LOG_IP_ADDRESS_IS"),
41 1 1. lambda$run$2 : replaced return value with null for com/jsql/view/swing/action/ActionCheckIP::lambda$run$2 → NO_COVERAGE
            () -> addressIp
42
        );
43
    }
44
}

Mutations

25

1.1
Location : actionPerformed
Killed by : none
removed call to java/lang/Thread::start → NO_COVERAGE

31

1.1
Location : run
Killed by : none
negated conditional → NO_COVERAGE

40

1.1
Location : lambda$run$1
Killed by : none
replaced return value with null for com/jsql/view/swing/action/ActionCheckIP::lambda$run$1 → NO_COVERAGE

41

1.1
Location : lambda$run$2
Killed by : none
replaced return value with null for com/jsql/view/swing/action/ActionCheckIP::lambda$run$2 → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1