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

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


                logger.fine("export(" + sre + ") method of constructed "
                        + "ProxyTrustExporter threw ExportException "
                        + "as expected.");
            }
        }
        Exporter me = new ValidMainExporter();
        exp = new Exporter[] {
            new RMCTENonPTBootExporter(),
            new PTTENonRMCBootExporter(),
            new RMCPTNonTEBootExporter(),
            new ExportExceptionExporter() };
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(
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 ISEExporter();
        Remote ro = new SPTRemoteObject();
        ProxyTrustExporter pte = createPTE(me, be);

        try {
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 IAEExporter();
        Remote ro = new SPTRemoteObject();
        ProxyTrustExporter pte = createPTE(me, be);

        try {
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);

View Full Code Here

TOP

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

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.