Examples of FakeClassLoader


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

        QAConfig config = (QAConfig) sysConfig;
        port = config.getIntConfigVal("HTTPServer.port", -1);
        manager.startService("HTTPServer");
        md = MessageDigest.getInstance("MD5");
        createFile(confFile, someValidConf);
        fakeClassLoader = new FakeClassLoader();
    }
View Full Code Here

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

        QAConfig config = (QAConfig) sysConfig;
        port = config.getIntConfigVal("HTTPServer.port", -1);
        manager.startService("HTTPServer");
        md = MessageDigest.getInstance("MD5");
        createFile(confFile, someValidConf);
        fakeClassLoader = new FakeClassLoader();
    }
View Full Code Here

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

        manager.startService("HTTPServer2");
        md = MessageDigest.getInstance("MD5");
        createFile(confFile, someValidConf);
        createFile(brokenConfFile, someBrokenConf);
        createFile(noAccessFile, someValidConf);
        fakeClassLoader = new FakeClassLoader();
    }
View Full Code Here

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

                + "providesIntegrity","" + providesIntegrity);

            ByteArrayInputStream bios =
                new ByteArrayInputStream(baos.toByteArray());
            MarshalInputStream input = new MarshalInputStream(
                bios,null,true,new FakeClassLoader(),context);
            input.useCodebaseAnnotations();

            // verify result

            if (shouldThrowException) {
View Full Code Here

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

            // set return value for verifier's providesIntegrity method
            System.setProperty(
                "com.sun.jini.test.spec.io.util.FakeIntegrityVerifier."
                + "providesIntegrity","" + providesIntegrity);

            FakeClassLoader verifierLoader = new FakeClassLoader();
            FakeClassLoader defaultLoader = new FakeClassLoader();

            // verify result

            if (Proxy.isProxyClass(loadClass)) {
                try {
View Full Code Here

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

            System.setProperty(
                "com.sun.jini.test.spec.io.util.FakeIntegrityVerifier."
                + "providesIntegrity","true");

            Object retObject = mi.get(
                null,requestIntegrity,new FakeClassLoader(),null);
            assertion(storeObject.equals(retObject),retObject.toString());

            retObject = mi.get(requestIntegrity);
            assertion(storeObject.equals(retObject),retObject.toString());
        }
View Full Code Here

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

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

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 {
                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
Copyright © 2018 www.massapi.com. 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.