Package org.codehaus.aspectwerkz.compiler

Examples of org.codehaus.aspectwerkz.compiler.VerifierClassLoader


     * since it uses custom class loader hierarchy.
     * See testWeavingClassLoader() commented method
     */
    public void testCustomClassLoaderWeaving() {
        try {
            VerifierClassLoader cl = new VerifierClassLoader(
                    new URL[]{new URL(targetPath)},
                    ClassLoader.getSystemClassLoader());

            Class target = cl.loadClass("test.xmldef.clapp.Target");
            assertEquals(target.getClassLoader().hashCode(), cl.hashCode());
            Method m = target.getMethod("callme", new Class[]{});
            String res = (String) m.invoke(target.newInstance(), new Object[]{});
            assertEquals("before call after", res);
        } catch (Throwable t) {
            t.printStackTrace();
View Full Code Here


        System.out.println(org.codehaus.aspectwerkz.extension.jrockit.JRockitPreProcessor.class.getClassLoader());

        while (true) {
            System.out.print(".");
            ClassLoader nonDelegatingCL = new VerifierClassLoader(new URL[]{(new File(args[0])).toURL()}, ClassLoader.getSystemClassLoader());
            Class loaded = nonDelegatingCL.loadClass(org.codehaus.aspectwerkz.extension.jrockit.JRockitPreProcessor.class.getName());
            Thread.sleep(500);
        }
    }
View Full Code Here

        targetPath = targetPath.substring(0, targetPath.indexOf("test/clapp/Target.class"));
    }

    public void testCustomClassLoaderWeaving() {
        try {
            VerifierClassLoader cl = new VerifierClassLoader(
                    new URL[]{new URL(targetPath)},
                    ClassLoader.getSystemClassLoader());

            Class target = cl.loadClass("test.clapp.Target");
            assertEquals(target.getClassLoader().hashCode(), cl.hashCode());
            Method m = target.getMethod("callme", new Class[]{});
            String res = (String) m.invoke(target.newInstance(), new Object[]{});
            assertEquals("before call after", res);
        } catch (Throwable t) {
            t.printStackTrace();
View Full Code Here

        System.out.println(org.codehaus.aspectwerkz.extension.jrockit.JRockitPreProcessor.class.getClassLoader());

        while (true) {
            System.out.print(".");
            ClassLoader nonDelegatingCL = new VerifierClassLoader(
                    new URL[]{(new File(args[0])).toURL()}, ClassLoader.getSystemClassLoader()
            );
            Class loaded = nonDelegatingCL.loadClass(
                    org.codehaus.aspectwerkz.extension.jrockit.JRockitPreProcessor.class.getName()
            );
            Thread.sleep(500);
        }
    }
View Full Code Here

     * Note: this test cannot be runned thru the WeavingClassLoader for debugging since it uses custom class loader
     * hierarchy. See testWeavingClassLoader() commented method
     */
    public void testCustomClassLoaderWeaving() {
        try {
            VerifierClassLoader cl = new VerifierClassLoader(
                    new URL[]{new URL(targetPath)},
                    ClassLoader.getSystemClassLoader()
            );

            Class target = cl.loadClass("test.clapp.Target");
            assertEquals(target.getClassLoader().hashCode(), cl.hashCode());
            Method m = target.getMethod("callme", new Class[]{});
            String res = (String)m.invoke(target.newInstance(), new Object[]{});
            assertEquals("before call after", res);
        }
        catch (Throwable t) {
View Full Code Here

     * since it uses custom class loader hierarchy.
     * See testWeavingClassLoader() commented method
     */
    public void testCustomClassLoaderWeaving() {
        try {
            VerifierClassLoader cl = new VerifierClassLoader(
                    new URL[]{new URL(targetPath)},
                    ClassLoader.getSystemClassLoader());

            Class target = cl.loadClass("test.xmldef.clapp.Target");
            assertEquals(target.getClassLoader().hashCode(), cl.hashCode());
            Method m = target.getMethod("callme", new Class[]{});
            String res = (String) m.invoke(target.newInstance(), new Object[]{});
            assertEquals("before call after", res);
        } catch (Throwable t) {
            t.printStackTrace();
View Full Code Here

        System.out.println(org.codehaus.aspectwerkz.extension.jrockit.JRockitPreProcessor.class.getClassLoader());

        while (true) {
            System.out.print(".");
            ClassLoader nonDelegatingCL = new VerifierClassLoader(new URL[]{(new File(args[0])).toURL()}, ClassLoader.getSystemClassLoader());
            Class loaded = nonDelegatingCL.loadClass(org.codehaus.aspectwerkz.extension.jrockit.JRockitPreProcessor.class.getName());
            Thread.sleep(500);
        }
    }
View Full Code Here

     * Note: this test cannot be runned thru the WeavingClassLoader for debugging since it uses custom class loader
     * hierarchy. See testWeavingClassLoader() commented method
     */
    public void testCustomClassLoaderWeaving() {
        try {
            VerifierClassLoader cl = new VerifierClassLoader(
                    new URL[]{new URL(targetPath)},
                    ClassLoader.getSystemClassLoader()
            );
            Class target = cl.loadClass("test.clapp.Target");
            assertEquals(target.getClassLoader().hashCode(), cl.hashCode());
            Method m = target.getMethod("callme", new Class[]{});
            String res = (String)m.invoke(target.newInstance(), new Object[]{});
            assertEquals("before call after", res);
        } catch (Throwable t) {
            t.printStackTrace();
View Full Code Here

     * Note: this test cannot be runned thru the WeavingClassLoader for debugging since it uses
     * custom class loader hierarchy. See testWeavingClassLoader() commented method
     */
    public void testCustomClassLoaderWeaving() {
        try {
            VerifierClassLoader cl = new VerifierClassLoader(new URL[] {
                new URL(targetPath)
            }, ClassLoader.getSystemClassLoader());
            Class target = cl.loadClass("test.clapp.Target");
            assertEquals(target.getClassLoader().hashCode(), cl.hashCode());
            Method m = target.getMethod("callme", new Class[] {});
            String res = (String) m.invoke(target.newInstance(), new Object[] {});
            assertEquals("before call after", res);
        } catch (Throwable t) {
            t.printStackTrace();
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.compiler.VerifierClassLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.