From: tcofoegbu Date: Tue, 9 May 2017 15:56:14 +0000 (+0100) Subject: JAL-2520 unit test for improvement to download structure files from URL before parsing X-Git-Tag: Release_2_10_2~3^2~57^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=57d8917fc33ed24c51e1fbb585617bd6f7defb8d;p=jalview.git JAL-2520 unit test for improvement to download structure files from URL before parsing --- 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); + } +}