summaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.loader/TestParent.java
blob: 3996b7671c0daa656dd3cacfd5ff15d94af2a8c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import java.net.*;

public class TestParent
{
  public static void main (String[] args)
  {
    URLClassLoader ucl =
      (URLClassLoader) ClassLoader.getSystemClassLoader();
    URL urls[] = ucl.getURLs ();

    MyLoader parent = new MyLoader (urls);

    MyLoader t1 = new MyLoader (urls, parent);
    MyLoader t2 = new MyLoader (urls, parent);

    Class c1, c2;

    try {

      c1 = t1.loadClass ("dummy");
      c2 = t2.loadClass ("dummy");

    }
    catch (Exception e) {
      e.printStackTrace ();
    }
  }
}