From 57d8917fc33ed24c51e1fbb585617bd6f7defb8d Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Tue, 9 May 2017 16:56:14 +0100 Subject: [PATCH] JAL-2520 unit test for improvement to download structure files from URL before parsing --- test/jalview/io/FileLoaderTest.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/jalview/io/FileLoaderTest.java diff --git a/test/jalview/io/FileLoaderTest.java b/test/jalview/io/FileLoaderTest.java new file mode 100644 index 0000000..0e21f6e --- /dev/null +++ b/test/jalview/io/FileLoaderTest.java @@ -0,0 +1,24 @@ +package jalview.io; + +import org.junit.Assert; +import org.testng.annotations.Test; + +public class FileLoaderTest +{ + + @Test(groups = { "Network" }) + public void testDownloadStructuresIfInputFromURL() + { + String urlFile = "http://www.jalview.org/builds/develop/examples/3W5V.pdb"; + FileLoader fileLoader = new FileLoader(); + fileLoader.LoadFileWaitTillLoaded(urlFile, DataSourceType.URL, + FileFormat.PDB); + Assert.assertNotNull(fileLoader.file); + // The FileLoader's file is expected to a temporary file different from the + // original URL. + Assert.assertNotEquals(urlFile, fileLoader.file); + // Data source type expected to be updated from DataSourceType.URL to + // DataSourceType.FILE + Assert.assertEquals(DataSourceType.FILE, fileLoader.protocol); + } +} -- 1.7.10.2