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

Examples of com.sun.jini.test.spec.security.proxytrust.util.ValidBootExporter


     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        ProxyTrustExporter pte;
        Exporter be = new ValidBootExporter();
        Remote sre = new SPTRemoteObject();
        Exporter[] exp = new Exporter[] {
            new TENonRMCMainExporter(),
            new RMCNonTEMainExporter(),
            new RMCTENonPublicIntMainExporter(),
View Full Code Here


     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        ValidMainExporter me = new ValidMainExporter();
        ValidBootExporter be = new ValidBootExporter();
        SPTRemoteObject ro = new SPTRemoteObject();
        ProxyTrustExporter pte = createPTE(me, be);
        Object res = pte.export(ro);

        if (me.getExpNum() != 1) {
            // FAIL
            throw new TestException(
                    "Export method of mainExporter was called "
                    + me.getExpNum() + " times while 1 was expected.");
        }

        // PASS
        logger.fine("Export method of mainExporter was called 1 time "
                + "as expected.");

        if (be.getExpNum() != 1) {
            // FAIL
            throw new TestException(
                    "Export method of bootExporter was called "
                    + be.getExpNum() + " times while 1 was expected.");
        }

        // PASS
        logger.fine("Export method of bootExporter was called 1 time "
                + "as expected.");

        if (!Proxy.isProxyClass(res.getClass())) {
            // FAIL
            throw new TestException(
                    "Returned by 'export' method result is not a dynamic "
                    + "Proxy class.");
        }

        // PASS
        logger.fine("Returned by 'export' method result is a dynamic "
                + "Proxy class as expected.");

        if (!ProxyTrustUtil.sameInterfaces(res, me.getProxy())) {
            // FAIL
            throw new TestException(
                    "List of interfaces implemented by class returned by "
                    + "'export' method call: "
                    + ProxyTrustUtil.interfacesToString(res)
                    + " is not equal to the one required: "
                    + ProxyTrustUtil.interfacesToString(me.getProxy()));
        }

        // PASS
        logger.fine("List of interfaces implemented by class returned by "
                + "'export' method call is the same as the one for "
                + "main proxy class as expected.");

        if (res.getClass().getClassLoader() !=
                me.getProxy().getClass().getClassLoader()) {
            // FAIL
            throw new TestException(
                    "Returned by 'export' method result is defined in "
                    + "class loader other than proxy produced by "
                    + "ValidMainExporter's 'export' method.");
        }

        // PASS
        logger.fine("Returned by 'export' method result is defined in "
                + "the same class loader as proxy produced by "
                + "ValidMainExporter's 'export' method as expected.");
        ProxyTrustInvocationHandler ptih = new ProxyTrustInvocationHandler(
                (RemoteMethodControl) me.getProxy(),
                (ProxyTrust) be.getProxy());

        if (!ptih.equals(Proxy.getInvocationHandler(res))) {
            // FAIL
            throw new TestException(
                    "Returned by 'export' method result does not contain "
View Full Code Here

            logger.fine("export(" + ro + ") method of constructed "
                    + "ProxyTrustExporter threw IllegalStateException "
                    + "as expected.");
        }
        me = new ISEExporter();
        be = new ValidBootExporter();
        pte = createPTE(me, be);

        try {
            pte.export(ro);
View Full Code Here

            logger.fine("export(" + ro + ") method of constructed "
                    + "ProxyTrustExporter threw ExportException "
                    + "as expected.");
        }
        me = new IAEExporter();
        be = new ValidBootExporter();
        pte = createPTE(me, be);

        try {
            pte.export(ro);

            // FAIL
            throw new TestException(
                    "export(" + ro + ") method of constructed "
                    + "ProxyTrustExporter did not throw any exception "
                    + "while IllegalArgumentException was expected.");
        } catch (IllegalArgumentException iae) {
            // PASS
            logger.fine("export(" + ro + ") method of constructed "
                    + "ProxyTrustExporter threw IllegalArgumentException "
                    + "as expected.");
        }
        me = new ValidBootExporter();
        ro = new RMCImpl();
        pte = createPTE(me, be);

        try {
            pte.export(ro);
View Full Code Here

     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        Exporter me = new ValidMainExporter();
        Exporter be = new ValidBootExporter();

        try {
            createPTE(me, null);

            // FAIL
View Full Code Here

TOP

Related Classes of com.sun.jini.test.spec.security.proxytrust.util.ValidBootExporter

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.