package net.sf.plugfy.verifier.java;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;

import net.sf.plugfy.verifier.VerificationContext;

import org.apache.bcel.util.ClassLoaderRepository;
import org.junit.Test;

/**
 * tests for ClassVerifier
 *
 * @author brummermann
 */
public class ClassVerifierTest {

    /**
     * test
     *
     * @throws IOException in case of an input/output error
     */
    @Test
    public void test() throws IOException {
        URL url = new File("sample/sample.jar").toURI().toURL();
        ClassLoader classLoader = new URLClassLoader(new URL[] {url});
        VerificationContext context = new VerificationContext(new ClassLoaderRepository(classLoader), classLoader);
        new ClassVerifier().verify(classLoader, "net.sf.plugfy.sample.SampleClass", context);
        System.out.println(context.getResult());

        System.out.println("-------------------");

        context = new VerificationContext(new ClassLoaderRepository(classLoader), classLoader);
        new ClassVerifier().verify(classLoader, "net.sf.plugfy.sample.SampleClass$SampleInner", context);
        System.out.println(context.getResult());
    }

}

@@ -1211,10 +1211,566 @@
 %0A    %7D%0A%0A
+    /**%0A     * test%0A     *%0A     * @throws IOException in case of an input/output error%0A     */%0A    @Test%0A    public void test2() throws IOException %7B%0A        URL url = new File(%22sample/sample-all.jar%22).toURI().toURL();%0A        ClassLoader classLoader = new URLClassLoader(new URL%5B%5D %7Burl%7D);%0A        VerificationContext context = new VerificationContext(new ClassLoaderRepository(classLoader), classLoader);%0A        new ClassVerifier().verify(classLoader, %22net.sf.plugfy.sample.SampleClass%22, context);%0A        System.out.println(context.getResult());%0A    %7D%0A%0A
 %7D%0A

test for methods