1 17 18 package org.apache.geronimo.system.url; 19 20 import java.net.URL ; 21 import java.net.URLStreamHandlerFactory ; 22 import java.net.URLStreamHandler ; 23 24 import junit.framework.TestCase; 25 26 31 public class GeronimoURLFactoryTest extends TestCase { 32 public void testForceInstall() throws Exception { 33 URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory () { 34 public URLStreamHandler createURLStreamHandler(String protocol) { 35 throw new RuntimeException ("Bogus handler still installed"); 36 } 37 }); 38 GeronimoURLFactory.forceInstall(); 39 new URL ("ftp://www.apache.org/"); 40 } 41 42 public void testSunURLHandlerAccess() throws Exception { 43 new URL ("ftp://www.apache.org/"); 44 new URL ("http://www.apache.org/index.html"); 45 new URL ("https://www.apache.org/index.html"); 46 new URL (" http://www.apache.org/index.html"); 47 } 48 } 49 50 | Popular Tags |