@Test public void execute_command_no_param() { ScannerForMSBuild build = ScannerForMSBuild.create() .setProjectDir(new File(".")) .setTimeoutSeconds(30); Map<String, String> props = new TreeMap<>(); ScannerForMSBuildInstaller installer = mock(ScannerForMSBuildInstaller.class); when(installer.install(isNull(), isNull(), any(), eq(false))).thenReturn(new File("SonarScanner.MSBuild.exe")); CommandExecutor executor = mock(CommandExecutor.class); when(executor.execute(any(Command.class), any(), anyLong())).thenReturn(2); new ScannerForMSBuildExecutor().execute(build, Configuration.create(), props, installer, executor); verify(executor).execute(argThat(c -> c.getDirectory().equals(new File(".")) && c.toCommandLine().contains("SonarScanner.MSBuild.exe")), any(), eq(30000L)); }
@Override BuildResult execute(ScannerForMSBuild build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor create) { return execute(build, config, adjustedProperties, new ScannerForMSBuildInstaller(config.locators()), create); }
ScannerForMSBuildExecutor extends AbstractBuildExecutor<ScannerForMSBuild> { @Override BuildResult execute(ScannerForMSBuild build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor create) { return execute(build, config, adjustedProperties, new ScannerForMSBuildInstaller(config.locators()), create); } }
ScannerForMSBuildExecutor extends AbstractBuildExecutor<ScannerForMSBuild> { @Override BuildResult execute(ScannerForMSBuild build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor create) { return execute(build, config, adjustedProperties, new ScannerForMSBuildInstaller(config.locators()), create); }  }
ScannerForMSBuildExecutor extends AbstractBuildExecutor<ScannerForMSBuild> { @Override BuildResult execute(ScannerForMSBuild build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor create) { return execute(build, config, adjustedProperties, new ScannerForMSBuildInstaller(config.locators()), create); }  static void addProp(Command c, String key, String value); }
ScannerForMSBuildExecutor extends AbstractBuildExecutor<ScannerForMSBuild> { @Override BuildResult execute(ScannerForMSBuild build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor create) { return execute(build, config, adjustedProperties, new ScannerForMSBuildInstaller(config.locators()), create); }  static void addProp(Command c, String key, String value);  }