3import java.io.IOException;
4import java.net.URISyntaxException;
6import java.net.URLConnection;
8import org.jau.io.IOUtil;
9import org.jau.net.AssetURLContext;
10import org.jau.net.Uri;
11import org.junit.Assert;
12import org.junit.FixMethodOrder;
14import org.junit.runners.MethodSorters;
16@FixMethodOrder(MethodSorters.NAME_ASCENDING)
20 testAssetConnection(createAssetURLConnection(test_asset_rt2_url, this.getClass().getClassLoader()), test_asset_rt_entry);
25 testAssetConnection(createAssetURLConnection(test_asset_rt_url, this.getClass().getClassLoader()), test_asset_rt_entry);
30 testAssetConnection(createAssetURLConnection(test_asset_test1_url, this.getClass().getClassLoader()), test_asset_test1_entry);
35 final URLConnection c = IOUtil.getResource(test_asset_rt_entry, this.getClass().getClassLoader());
36 testAssetConnection(c, test_asset_rt_entry);
41 final URLConnection urlConn0 = IOUtil.getResource(test_asset_test2_rel.get(),
this.getClass().getClassLoader(),
this.getClass());
42 testAssetConnection(urlConn0, test_asset_test2_entry);
44 final Uri uri1 = Uri.valueOf(urlConn0.getURL()).getRelativeOf(test_asset_test3_rel);
45 Assert.assertNotNull(uri1);
46 testAssetConnection(uri1.toURL().openConnection(), test_asset_test3_entry);
48 final Uri uri2 = Uri.valueOf(urlConn0.getURL()).getRelativeOf(test_asset_test4_rel);
49 Assert.assertNotNull(uri2);
50 testAssetConnection(uri2.toURL().openConnection(), test_asset_test4_entry);
54 final URL url = AssetURLContext.createURL(path, cl);
55 final URLConnection c = url.openConnection();
56 System.err.println(
"createAssetURL: "+path+
" -> url: "+url+
" -> conn: "+c+
" / connURL "+(
null!=c?c.getURL():
null));
60 public static void main(
final String args[])
throws IOException {
62 org.junit.runner.JUnitCore.
main(tstname);
void assetUnregisteredIOUtilGetResourceAbs_RT()
void assetUnregisteredURLConnection_RT()
void assetUnregisteredURLConnection_Test()
void assetUnregisteredIOUtilGetResourceRel0_RT()
static void main(final String args[])
static URLConnection createAssetURLConnection(final String path, final ClassLoader cl)
void assetUnregisteredURLConnection_RT2()