Package org.voltdb.utils.InMemoryJarfile

Examples of org.voltdb.utils.InMemoryJarfile.JarLoader


            // out fragments
            CatalogAndIds catalogStuff = null;
            try {
                catalogStuff = CatalogUtil.getCatalogFromZK(VoltDB.instance().getHostMessenger().getZK());
                InMemoryJarfile testjar = new InMemoryJarfile(catalogStuff.catalogBytes);
                JarLoader testjarloader = testjar.getLoader();
                for (String classname : testjarloader.getClassNames()) {
                    try {
                        Class.forName(classname, true, testjarloader);
                    }
                    // LinkageError catches most of the various class loading errors we'd
                    // care about here.
View Full Code Here


        // Add a class file that we know has inner classes
        // Someday this seems like it should be an operation directly on InMemoryJarfile
        VoltCompiler comp = new VoltCompiler();
        // This will pull in all the inner classes (currently 4 of them), but check anyway
        comp.addClassToJar(dut, org.voltdb_testprocs.updateclasses.InnerClassesTestProc.class);
        JarLoader loader = dut.getLoader();
        assertEquals(5, loader.getClassNames().size());
        System.out.println(loader.getClassNames());
        assertTrue(loader.getClassNames().contains("org.voltdb_testprocs.updateclasses.InnerClassesTestProc$InnerNotPublic"));
        assertTrue(dut.get("org/voltdb_testprocs/updateclasses/InnerClassesTestProc$InnerNotPublic.class") != null);

        // Now, remove the outer class and verify that all the inner classes go away.
        dut.removeClassFromJar("org.voltdb_testprocs.updateclasses.InnerClassesTestProc");
        assertTrue(loader.getClassNames().isEmpty());
        assertTrue(dut.get("org/voltdb_testprocs/updateclasses/InnerClassesTestProc$InnerNotPublic.class") == null);
    }
View Full Code Here

TOP

Related Classes of org.voltdb.utils.InMemoryJarfile.JarLoader

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.