diff options
author | Sven Gothel <[email protected]> | 2013-06-09 05:33:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-09 05:33:16 +0200 |
commit | b98825eb7cfb61aead4a7dff57471cd2d2c26823 (patch) | |
tree | 8190c7eaac697e4150e47424dc975be512a3979d /src/junit/com/jogamp/common/net/AssetURLConnectionRegisteredTest.java | |
parent | 959d6d83ec26152343d538287c02eeebf0dcf238 (diff) |
Fix Bug 683 part1: IOUtil, JarUtil, TempJarCache, .. uses URI instead of URL to remove DNS Lookups etc ..
Diffstat (limited to 'src/junit/com/jogamp/common/net/AssetURLConnectionRegisteredTest.java')
-rw-r--r-- | src/junit/com/jogamp/common/net/AssetURLConnectionRegisteredTest.java | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/junit/com/jogamp/common/net/AssetURLConnectionRegisteredTest.java b/src/junit/com/jogamp/common/net/AssetURLConnectionRegisteredTest.java index edf1592..2db3fb3 100644 --- a/src/junit/com/jogamp/common/net/AssetURLConnectionRegisteredTest.java +++ b/src/junit/com/jogamp/common/net/AssetURLConnectionRegisteredTest.java @@ -1,6 +1,8 @@ package com.jogamp.common.net; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; @@ -36,39 +38,39 @@ public class AssetURLConnectionRegisteredTest extends AssetURLConnectionBase { } @Test - public void assetRegisteredIOUtilGetResourceRel1_RT() throws IOException { + public void assetRegisteredIOUtilGetResourceRel1_RT() throws IOException, URISyntaxException { final URLConnection urlConn0 = IOUtil.getResource(test_asset_test2a_url, this.getClass().getClassLoader()); Assert.assertNotNull(urlConn0); Assert.assertEquals(test_asset_test2a_url, urlConn0.getURL().toExternalForm()); testAssetConnection(urlConn0, test_asset_test2_entry); - final URL url1 = IOUtil.getRelativeOf(urlConn0.getURL(), test_asset_test3_rel); - Assert.assertNotNull(url1); - Assert.assertEquals(test_asset_test3a_url, url1.toExternalForm()); - testAssetConnection(url1.openConnection(), test_asset_test3_entry); + final URI uri1 = IOUtil.getRelativeOf(urlConn0.getURL().toURI(), test_asset_test3_rel); + Assert.assertNotNull(uri1); + Assert.assertEquals(test_asset_test3a_url, uri1.toString()); + testAssetConnection(uri1.toURL().openConnection(), test_asset_test3_entry); - final URL url2 = IOUtil.getRelativeOf(urlConn0.getURL(), test_asset_test4_rel); - Assert.assertNotNull(url1); - Assert.assertEquals(test_asset_test4a_url, url2.toExternalForm()); - testAssetConnection(url2.openConnection(), test_asset_test4_entry); + final URI uri2 = IOUtil.getRelativeOf(urlConn0.getURL().toURI(), test_asset_test4_rel); + Assert.assertNotNull(uri2); + Assert.assertEquals(test_asset_test4a_url, uri2.toString()); + testAssetConnection(uri2.toURL().openConnection(), test_asset_test4_entry); } @Test - public void assetRegisteredIOUtilGetResourceRel2_RT() throws IOException { + public void assetRegisteredIOUtilGetResourceRel2_RT() throws IOException, URISyntaxException { final URLConnection urlConn0 = IOUtil.getResource(test_asset_test2b_url, this.getClass().getClassLoader()); Assert.assertNotNull(urlConn0); Assert.assertEquals(test_asset_test2b_url, urlConn0.getURL().toExternalForm()); testAssetConnection(urlConn0, test_asset_test2_entry); - final URL url1 = IOUtil.getRelativeOf(urlConn0.getURL(), test_asset_test3_rel); - Assert.assertNotNull(url1); - Assert.assertEquals(test_asset_test3b_url, url1.toExternalForm()); - testAssetConnection(url1.openConnection(), test_asset_test3_entry); + final URI uri1 = IOUtil.getRelativeOf(urlConn0.getURL().toURI(), test_asset_test3_rel); + Assert.assertNotNull(uri1); + Assert.assertEquals(test_asset_test3b_url, uri1.toString()); + testAssetConnection(uri1.toURL().openConnection(), test_asset_test3_entry); - final URL url2 = IOUtil.getRelativeOf(urlConn0.getURL(), test_asset_test4_rel); - Assert.assertNotNull(url1); - Assert.assertEquals(test_asset_test4b_url, url2.toExternalForm()); - testAssetConnection(url2.openConnection(), test_asset_test4_entry); + final URI uri2 = IOUtil.getRelativeOf(urlConn0.getURL().toURI(), test_asset_test4_rel); + Assert.assertNotNull(uri2); + Assert.assertEquals(test_asset_test4b_url, uri2.toString()); + testAssetConnection(uri2.toURL().openConnection(), test_asset_test4_entry); } URLConnection createAssetURLConnection(String path) throws IOException { |