package javax.xml.crypto.test.dsig;

import java.lang.reflect.Method;
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;

import junit.framework.*;

/**
 * This test uses more than one classloader to load a class (Driver) that
 * invokes the XMLSignature API. It tests that there are not provider class 
 * loading issues with more than one classloader (see 6380953).
 */
public class ClassLoaderTest extends TestCase {

    public ClassLoaderTest(String name) {
	super(name);
    }

    public void test_multiple_loaders() throws Exception {

	String baseDir = System.getProperty("basedir");
	String fs = System.getProperty("file.separator");
        File file0 = new File(baseDir + fs + "build" + fs + "classes" + fs);
        File file1 = new File(baseDir + fs + "build" + fs + "test" + fs);
        URL[] urls = new URL[2];
        urls[0] = file0.toURL();
        urls[1] = file1.toURL();
        URLClassLoader uc1 = new URLClassLoader(urls, null);
        URLClassLoader uc2 = new URLClassLoader(urls, null);

        Class c1 = uc1.loadClass("javax.xml.crypto.test.dsig.Driver");
        Class c2 = uc2.loadClass("javax.xml.crypto.test.dsig.Driver");
        Object o1 = c1.newInstance();
        Object o2 = c2.newInstance();
        Method m1 = c1.getMethod("dsig", null);
        Method m2 = c2.getMethod("dsig", null);
        m1.invoke(o1, null);
        m2.invoke(o2, null);
    }
}

@@ -1283,32 +1283,42 @@
 etMethod(%22dsig%22,
+ (Class%5B%5D)
  null);%0A        
@@ -1349,16 +1349,26 @@
 (%22dsig%22,
+ (Class%5B%5D)
  null);%0A
@@ -1388,16 +1388,27 @@
 voke(o1,
+ (Object%5B%5D)
  null);%0A
@@ -1428,16 +1428,27 @@
 voke(o2,
+ (Object%5B%5D)
  null);%0A

Fix compiler warnings.