Exemplo n.º 1
0
 @DataProvider
 public static ClassLoader[][] provider() {
   try {
     return new ClassLoader[][] {
       {ClassLoader.getSystemClassLoader()},
       {new MyClassLoader()},
       {
         new URLClassLoader(
             new URL[] {Paths.get(".").toUri().toURL()}, ClassLoader.getSystemClassLoader())
       }
     };
   } catch (MalformedURLException e) {
     throw new RuntimeException(e);
   }
 }
Exemplo n.º 2
0
 @Test(dataProvider = "provider", expectedExceptions = NullPointerException.class)
 public void loaderGetResourceAsStream(ClassLoader cl) {
   cl.getResourceAsStream(null);
 }
Exemplo n.º 3
0
 @Test(dataProvider = "provider", expectedExceptions = NullPointerException.class)
 public static void loaderResources(ClassLoader cl) throws IOException {
   Stream<URL> retVal = cl.resources(null);
 }