Package com.sun.jini.test.spec.security.util

Examples of com.sun.jini.test.spec.security.util.FakeClassLoader


                        new Class[] { Class.class });

                if (useNullLoader[i]) {
                    testCl = null;
                } else {
                    testCl = new FakeClassLoader(jarFile.toURI().toURL());
                }

                try {
                    callVerifyCodebaseIntegrity(wrongUrls[j], testCl);

                    // FAIL
                    throw new TestException(
                            "Method did not throw any exception while "
                            + "MalformedURLException was expected.");
                } catch (MalformedURLException mue) {
                    // PASS
                    logger.fine("MalformedURLException was thrown "
                            + "as expected.");
                } finally {
                    jarFile.delete();
                }
            }
            logger.fine("=========== Check correct URLs ===========");

            for (int j = 0; j < clNames.length; ++j) {
                logger.fine("========== Iteration #" + (j + 1)
                        + " ==========");
                logger.fine("Test integrity verifiers are: "
                        + Util.arrayToString(clNames[j]));

                for (int k = 0; k < testUrls.length; ++k) {
                    BaseIntegrityVerifier.initLists();
                    jarFile = Util.createResourceJar(resName, clNames[j]);
                    expRes = getExpRes(clNames[j], testUrls[k]);

                    if (useNullLoader[i]) {
                        testCl = null;
                    } else {
                        testCl = new FakeClassLoader(jarFile.toURI().toURL());
                    }
                    Thread.currentThread().setContextClassLoader(
                            new FakeClassLoader(jarFile.toURI().toURL()));

                    try {
                        callVerifyCodebaseIntegrity(testUrls[k], testCl);

                        if (expRes != null) {
View Full Code Here


                        new Class[] { Class.class });

                if (useNullLoader[i]) {
                    testCl = null;
                } else {
                    testCl = new FakeClassLoader(jarFile.toURI().toURL());
                }

                try {
                    callVerifyCodebaseIntegrity(wrongUrls[j], testCl);

                    // FAIL
                    throw new TestException(
                            "Method did not throw any exception while "
                            + "MalformedURLException was expected.");
                } catch (MalformedURLException mue) {
                    // PASS
                    logger.fine("MalformedURLException was thrown "
                            + "as expected.");
                } finally {
                    jarFile.delete();
                }
            }
            logger.fine("=========== Check correct URLs ===========");

            for (int j = 0; j < clNames.length; ++j) {
                logger.fine("========== Iteration #" + (j + 1)
                        + " ==========");
                logger.fine("Test integrity verifiers are: "
                        + Util.arrayToString(clNames[j]));

                for (int k = 0; k < testUrls.length; ++k) {
                    BaseIntegrityVerifier.initLists();
                    jarFile = Util.createResourceJar(resName, clNames[j]);
                    expRes = getExpRes(clNames[j], testUrls[k]);

                    if (useNullLoader[i]) {
                        testCl = null;
                    } else {
                        testCl = new FakeClassLoader(jarFile.toURI().toURL());
                    }
                    Thread.currentThread().setContextClassLoader(
                            new FakeClassLoader(jarFile.toURI().toURL()));

                    try {
                        callVerifyCodebaseIntegrity(testUrls[k], testCl);

                        if (expRes != null) {
View Full Code Here

                    new Class[] { Class.class });

            if (useNullLoader[i]) {
                testCl = null;
            } else {
                testCl = new FakeClassLoader(jarFile.toURI().toURL());
            }

            try {
                callVerifyObjectTrust(testObj, testCl, null);

                // FAIL
                throw new TestException(
                        "Method did not throw any exception while "
                        + "NullPointerException was expected.");
            } catch (NullPointerException npe) {
                // PASS
                logger.fine("NullPointerException was thrown as expected.");
            } finally {
                jarFile.delete();
            }

            for (int j = 0; j < clNames.length; ++j) {
                BaseTrustVerifier.initLists();
                logger.fine("========== Iteration #" + (j + 1)
                        + " ==========");
                logger.fine("Test trust verifiers are: "
                        + Util.arrayToString(clNames[j]));
                jarFile = Util.createResourceJar(resName, clNames[j]);
                expRes = getExpRes(clNames[j]);

                if (useNullLoader[i]) {
                    testCl = null;
                } else {
                    testCl = new FakeClassLoader(jarFile.toURI().toURL());
                }
                Thread.currentThread().setContextClassLoader(
                        new FakeClassLoader(jarFile.toURI().toURL()));

                try {
                    callVerifyObjectTrust(testObj, testCl, testCtx);

                    if (expRes != null) {
View Full Code Here

TOP

Related Classes of com.sun.jini.test.spec.security.util.FakeClassLoader

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.