@Test public void fail_if_file_doesnt_exist() throws Exception { File toDir = temp.newFolder(); thrown.expect(IllegalArgumentException.class); thrown.expectMessage("File doesn't exist"); installer.install(null, FileLocation.of(new File("unknown")), toDir, false); }
public File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore) { if (location != null) { return installFromLocation(location, toDir, useDotNetCore); } else if (scannerVersion != null) { return install(scannerVersion, toDir, useDotNetCore); } else { return install(Version.create(DEFAULT_SCANNER_VERSION), toDir, useDotNetCore); } }
ScannerForMSBuildInstaller { public File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore) { if (location != null) { return installFromLocation(location, toDir, useDotNetCore); } else if (scannerVersion != null) { return install(scannerVersion, toDir, useDotNetCore); } else { return install(Version.create(DEFAULT_SCANNER_VERSION), toDir, useDotNetCore); } } }
ScannerForMSBuildInstaller { public File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore) { if (location != null) { return installFromLocation(location, toDir, useDotNetCore); } else if (scannerVersion != null) { return install(scannerVersion, toDir, useDotNetCore); } else { return install(Version.create(DEFAULT_SCANNER_VERSION), toDir, useDotNetCore); } } ScannerForMSBuildInstaller(Locators locators); }
ScannerForMSBuildInstaller { public File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore) { if (location != null) { return installFromLocation(location, toDir, useDotNetCore); } else if (scannerVersion != null) { return install(scannerVersion, toDir, useDotNetCore); } else { return install(Version.create(DEFAULT_SCANNER_VERSION), toDir, useDotNetCore); } } ScannerForMSBuildInstaller(Locators locators); File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore); }
ScannerForMSBuildInstaller { public File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore) { if (location != null) { return installFromLocation(location, toDir, useDotNetCore); } else if (scannerVersion != null) { return install(scannerVersion, toDir, useDotNetCore); } else { return install(Version.create(DEFAULT_SCANNER_VERSION), toDir, useDotNetCore); } } ScannerForMSBuildInstaller(Locators locators); File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore); static final String DEFAULT_SCANNER_VERSION; static final String NETCOREAPP_2_0; static final String NET_46; }