@Test(expected = NullPointerException.class) public void errorThrownIfThereIsNoHashTypeInFileDownloadListFileDetailsAndHashShouldBeChecked() throws Exception { DriverDetails fileDetails = new DriverDetails(); fileDetails.fileLocation = downloadZipURL; fileDetails.hashType = null; fileDetails.hash = validSHA1Hash; DriverMap driverMap = new DriverMap(); driverMap.getMapForDriverContext(binaryDataFor(OSX, GOOGLECHROME, ARCHITECTURE_64_BIT)).put("2.13", fileDetails); DownloadHandler downloadTestFile = new DownloadHandler(new File(rootStandaloneServerDirectoryPath), new File(downloadDirectoryPath), oneRetryAttempt, connectTimeout, readTimeout, driverMap, overwriteFilesThatExist, checkFileHashes, doNotUseSystemProxy, getAllVersions); downloadTestFile.ensureStandaloneExecutableFilesExist(); }
public DriverMap ensureStandaloneExecutableFilesExist() throws MojoFailureException, MojoExecutionException, IOException, URISyntaxException { LOG.info("Archives will be downloaded to '" + this.downloadedZipFileDirectory.getAbsolutePath() + "'"); LOG.info("Standalone executable files will be extracted to '" + this.rootStandaloneServerDirectory + "'"); LOG.info(" "); LOG.info("Preparing to download Selenium Standalone Executable Binaries..."); for (final DriverContext driverContext : filesToDownload.getKeys()) { if (onlyGetLatestVersions) { DriverDetails driverDetails = filesToDownload.getDetailsForLatestVersionOfDriverContext(driverContext); downloadAndExtractExecutableFiles(driverContext, driverDetails); } else { for (String version : filesToDownload.getAvailableVersionsForDriverContext(driverContext)) { DriverDetails driverDetails = filesToDownload.getDetailsForVersionOfDriverContext(driverContext, version); downloadAndExtractExecutableFiles(driverContext, driverDetails); } } } return filesToDownload; }
DownloadHandler { public DriverMap ensureStandaloneExecutableFilesExist() throws MojoFailureException, MojoExecutionException, IOException, URISyntaxException { LOG.info("Archives will be downloaded to '" + this.downloadedZipFileDirectory.getAbsolutePath() + "'"); LOG.info("Standalone executable files will be extracted to '" + this.rootStandaloneServerDirectory + "'"); LOG.info(" "); LOG.info("Preparing to download Selenium Standalone Executable Binaries..."); for (final DriverContext driverContext : filesToDownload.getKeys()) { if (onlyGetLatestVersions) { DriverDetails driverDetails = filesToDownload.getDetailsForLatestVersionOfDriverContext(driverContext); downloadAndExtractExecutableFiles(driverContext, driverDetails); } else { for (String version : filesToDownload.getAvailableVersionsForDriverContext(driverContext)) { DriverDetails driverDetails = filesToDownload.getDetailsForVersionOfDriverContext(driverContext, version); downloadAndExtractExecutableFiles(driverContext, driverDetails); } } } return filesToDownload; } }
DownloadHandler { public DriverMap ensureStandaloneExecutableFilesExist() throws MojoFailureException, MojoExecutionException, IOException, URISyntaxException { LOG.info("Archives will be downloaded to '" + this.downloadedZipFileDirectory.getAbsolutePath() + "'"); LOG.info("Standalone executable files will be extracted to '" + this.rootStandaloneServerDirectory + "'"); LOG.info(" "); LOG.info("Preparing to download Selenium Standalone Executable Binaries..."); for (final DriverContext driverContext : filesToDownload.getKeys()) { if (onlyGetLatestVersions) { DriverDetails driverDetails = filesToDownload.getDetailsForLatestVersionOfDriverContext(driverContext); downloadAndExtractExecutableFiles(driverContext, driverDetails); } else { for (String version : filesToDownload.getAvailableVersionsForDriverContext(driverContext)) { DriverDetails driverDetails = filesToDownload.getDetailsForVersionOfDriverContext(driverContext, version); downloadAndExtractExecutableFiles(driverContext, driverDetails); } } } return filesToDownload; } DownloadHandler(File rootStandaloneServerDirectory, File downloadedZipFileDirectory, int fileDownloadRetryAttempts, int fileDownloadConnectTimeout, int fileDownloadReadTimeout, DriverMap filesToDownload, boolean overwriteFilesThatExist, boolean checkFileHash, boolean useSystemProxy, boolean onlyGetLatestVersions); }
DownloadHandler { public DriverMap ensureStandaloneExecutableFilesExist() throws MojoFailureException, MojoExecutionException, IOException, URISyntaxException { LOG.info("Archives will be downloaded to '" + this.downloadedZipFileDirectory.getAbsolutePath() + "'"); LOG.info("Standalone executable files will be extracted to '" + this.rootStandaloneServerDirectory + "'"); LOG.info(" "); LOG.info("Preparing to download Selenium Standalone Executable Binaries..."); for (final DriverContext driverContext : filesToDownload.getKeys()) { if (onlyGetLatestVersions) { DriverDetails driverDetails = filesToDownload.getDetailsForLatestVersionOfDriverContext(driverContext); downloadAndExtractExecutableFiles(driverContext, driverDetails); } else { for (String version : filesToDownload.getAvailableVersionsForDriverContext(driverContext)) { DriverDetails driverDetails = filesToDownload.getDetailsForVersionOfDriverContext(driverContext, version); downloadAndExtractExecutableFiles(driverContext, driverDetails); } } } return filesToDownload; } DownloadHandler(File rootStandaloneServerDirectory, File downloadedZipFileDirectory, int fileDownloadRetryAttempts, int fileDownloadConnectTimeout, int fileDownloadReadTimeout, DriverMap filesToDownload, boolean overwriteFilesThatExist, boolean checkFileHash, boolean useSystemProxy, boolean onlyGetLatestVersions); DriverMap ensureStandaloneExecutableFilesExist(); }
DownloadHandler { public DriverMap ensureStandaloneExecutableFilesExist() throws MojoFailureException, MojoExecutionException, IOException, URISyntaxException { LOG.info("Archives will be downloaded to '" + this.downloadedZipFileDirectory.getAbsolutePath() + "'"); LOG.info("Standalone executable files will be extracted to '" + this.rootStandaloneServerDirectory + "'"); LOG.info(" "); LOG.info("Preparing to download Selenium Standalone Executable Binaries..."); for (final DriverContext driverContext : filesToDownload.getKeys()) { if (onlyGetLatestVersions) { DriverDetails driverDetails = filesToDownload.getDetailsForLatestVersionOfDriverContext(driverContext); downloadAndExtractExecutableFiles(driverContext, driverDetails); } else { for (String version : filesToDownload.getAvailableVersionsForDriverContext(driverContext)) { DriverDetails driverDetails = filesToDownload.getDetailsForVersionOfDriverContext(driverContext, version); downloadAndExtractExecutableFiles(driverContext, driverDetails); } } } return filesToDownload; } DownloadHandler(File rootStandaloneServerDirectory, File downloadedZipFileDirectory, int fileDownloadRetryAttempts, int fileDownloadConnectTimeout, int fileDownloadReadTimeout, DriverMap filesToDownload, boolean overwriteFilesThatExist, boolean checkFileHash, boolean useSystemProxy, boolean onlyGetLatestVersions); DriverMap ensureStandaloneExecutableFilesExist();  }