CommanderFactory.java

1
package com.github.dakusui.actionunit.actions.cmd;
2
3
import com.github.dakusui.actionunit.actions.cmd.unix.SshOptions;
4
5
import java.util.function.Function;
6
7
import static java.util.Objects.requireNonNull;
8
9
public interface CommanderFactory {
10
  CommanderConfig config();
11
12
  abstract class Base implements CommanderFactory {
13
    final CommanderConfig              commanderConfig;
14
15
16
    protected Base(CommanderConfig commanderConfig) {
17
      this.commanderConfig = requireNonNull(commanderConfig);
18
    }
19
20
    @Override
21
    public CommanderConfig config() {
22 1 1. config : replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Base::config → KILLED
      return this.commanderConfig;
23
    }
24
  }
25
26
  abstract class Builder<B extends Builder<B, C>, C extends CommanderFactory> {
27
    CommanderConfig              config;
28
    Function<String, SshOptions> sshOptionsResolver;
29
30
    protected Builder() {
31 1 1. lambda$new$0 : replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::lambda$new$0 → NO_COVERAGE
      this.sshOptionsResolver(h -> new SshOptions.Builder().build())
32
          .config(new CommanderConfig.Builder().build());
33
    }
34
35
    @SuppressWarnings("unchecked")
36
    public B config(CommanderConfig config) {
37
      this.config = requireNonNull(config);
38 1 1. config : replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::config → KILLED
      return (B) this;
39
    }
40
41
    @SuppressWarnings("unchecked")
42
    public B sshOptionsResolver(Function<String, SshOptions> sshOptionsResolver) {
43
      this.sshOptionsResolver = requireNonNull(sshOptionsResolver);
44 1 1. sshOptionsResolver : replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::sshOptionsResolver → KILLED
      return (B) this;
45
    }
46
47
    public C build() {
48 1 1. build : replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::build → KILLED
      return createCommanderFactory(config, sshOptionsResolver);
49
    }
50
51
    protected abstract C createCommanderFactory(CommanderConfig config, Function<String, SshOptions> sshOptions);
52
  }
53
}

Mutations

22

1.1
Location : config
Killed by : com.github.dakusui.actionunit.ut.actions.cmd.UnixCommanderFactoryTest$WithCustomSshOptions2.composeLocalEchoCommandLine(com.github.dakusui.actionunit.ut.actions.cmd.UnixCommanderFactoryTest$WithCustomSshOptions2)
replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Base::config → KILLED

31

1.1
Location : lambda$new$0
Killed by : none
replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::lambda$new$0 → NO_COVERAGE

38

1.1
Location : config
Killed by : com.github.dakusui.actionunit.ut.actions.cmd.UnixCommanderFactoryTest$WithCustomSshOptions2.composeLocalEchoCommandLine(com.github.dakusui.actionunit.ut.actions.cmd.UnixCommanderFactoryTest$WithCustomSshOptions2)
replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::config → KILLED

44

1.1
Location : sshOptionsResolver
Killed by : com.github.dakusui.actionunit.ut.actions.cmd.UnixCommanderFactoryTest$WithCustomSshOptions2.composeLocalEchoCommandLine(com.github.dakusui.actionunit.ut.actions.cmd.UnixCommanderFactoryTest$WithCustomSshOptions2)
replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::sshOptionsResolver → KILLED

48

1.1
Location : build
Killed by : com.github.dakusui.actionunit.ut.actions.cmd.UnixCommanderFactoryTest$WithCustomSshOptions2.composeLocalEchoCommandLine(com.github.dakusui.actionunit.ut.actions.cmd.UnixCommanderFactoryTest$WithCustomSshOptions2)
replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::build → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3