--- /dev/null
+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);
+ }
+}