summaryrefslogtreecommitdiffstats
path: root/filedistribution
diff options
context:
space:
mode:
Diffstat (limited to 'filedistribution')
-rw-r--r--filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java b/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java
index d7700467494..c4848140b2d 100644
--- a/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java
+++ b/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java
@@ -103,7 +103,7 @@ public class FileDownloaderTest {
{
// fileReference does not exist on disk, needs to be downloaded)
- FileReference fileReference = new FileReference("fileReference");
+ FileReference fileReference = new FileReference("baz");
File fileReferenceFullPath = fileReferenceFullPath(downloadDir, fileReference);
assertFalse(fileReferenceFullPath.getAbsolutePath(), fileDownloader.getFile(fileReference).isPresent());
@@ -202,7 +202,7 @@ public class FileDownloaderTest {
// Delay response so that we can make a second request while downloading the file from the first request
connection.setResponseHandler(new MockConnection.WaitResponseHandler(Duration.ofSeconds(1)));
- FileReference fileReference = new FileReference("fileReference");
+ FileReference fileReference = new FileReference("fileReference123");
File fileReferenceFullPath = fileReferenceFullPath(downloadDir, fileReference);
FileReferenceDownload fileReferenceDownload = new FileReferenceDownload(fileReference);
@@ -237,25 +237,25 @@ public class FileDownloaderTest {
MockConnection connectionPool = new MockConnection();
connectionPool.setResponseHandler(new MockConnection.WaitResponseHandler(timeout.plus(Duration.ofMillis(1000))));
FileDownloader fileDownloader = new FileDownloader(connectionPool, downloadDir, downloads, timeout, sleepBetweenRetries);
- FileReference foo = new FileReference("foo");
+ FileReference xyzzy = new FileReference("xyzzy");
// Should download since we do not have the file on disk
- fileDownloader.downloadIfNeeded(new FileReferenceDownload(foo));
- assertTrue(fileDownloader.isDownloading(foo));
- assertFalse(fileDownloader.getFile(foo).isPresent());
+ fileDownloader.downloadIfNeeded(new FileReferenceDownload(xyzzy));
+ assertTrue(fileDownloader.isDownloading(xyzzy));
+ assertFalse(fileDownloader.getFile(xyzzy).isPresent());
// Receive files to simulate download
- receiveFile();
+ receiveFile(fileDownloader, xyzzy, "xyzzy.jar", FileReferenceData.Type.file, "content");
// Should not download, since file has already been downloaded
- fileDownloader.downloadIfNeeded(new FileReferenceDownload(foo));
+ fileDownloader.downloadIfNeeded(new FileReferenceDownload(xyzzy));
// and file should be available
- assertTrue(fileDownloader.getFile(foo).isPresent());
+ assertTrue(fileDownloader.getFile(xyzzy).isPresent());
}
@Test
public void receiveFile() throws IOException {
- FileReference foo = new FileReference("foo");
+ FileReference foobar = new FileReference("foobar");
String filename = "foo.jar";
- receiveFile(fileDownloader, foo, filename, FileReferenceData.Type.file, "content");
- File downloadedFile = new File(fileReferenceFullPath(downloadDir, foo), filename);
+ receiveFile(fileDownloader, foobar, filename, FileReferenceData.Type.file, "content");
+ File downloadedFile = new File(fileReferenceFullPath(downloadDir, foobar), filename);
assertEquals("content", IOUtils.readFile(downloadedFile));
}