Package net.jini.security.proxytrust

Examples of net.jini.security.proxytrust.SingletonProxyTrustIterator


        ProxyTrustIterator pti = null;
        Object obj = new Object();
        RemoteException re = new RemoteException();

        try {
            pti = new SingletonProxyTrustIterator(null);

            // FAIL
            throw new TestException(
                    "Constructor invocation of SingletonProxyTrustIterator "
                    + "with null parameter did not throw any exception "
                    + "while NullPointerException was expected.");
        } catch (NullPointerException npe) {
            // PASS
            logger.fine("Constructor invocation of "
                    + "SingletonProxyTrustIterator with null parameter "
                    + "threw NullPointerException as expected.");
        }
        pti = new SingletonProxyTrustIterator(obj);
        logger.fine("Constructed SingletonProxyTrustIterator(" + obj + ").");

            try {
            pti.setException(re);

            // FAIL
            throw new TestException(
                    "'setExcepion' method invocation of constructed "
                    + "SingletonProxyTrustIterator just after it's "
                    + "construction did not throw any exception "
                    + "while IllegalStateException was expected.");
        } catch (IllegalStateException ise) {
            // PASS
            logger.fine("'setExcepion' method invocation of constructed "
                    + "SingletonProxyTrustIterator just after it's "
                    + "construction threw IllegalStateException "
                    + "as expected.");
        }

        if (!pti.hasNext()) {
            // FAIL
            throw new TestException(
                    "First 'hasNext' method invocation of constructed "
                    + "SingletonProxyTrustIterator just after it's "
                    + "construction returned false while true was "
                    + "expected");
        }

        // PASS
        logger.fine("First 'hasNext' method invocation of constructed "
                + "SingletonProxyTrustIterator just after it's "
                + "construction returned true as expected");

        try {
            pti.setException(re);

            // FAIL
            throw new TestException(
                    "'setExcepion' method invocation of constructed "
                    + "SingletonProxyTrustIterator after it's 'hasNext' "
                    + "method invocation did not throw any exception "
                    + "while IllegalStateException was expected.");
        } catch (IllegalStateException ise) {
            // PASS
            logger.fine("'setExcepion' method invocation of constructed "
                    + "SingletonProxyTrustIterator after it's 'hasNext' "
                    + "method invocation threw IllegalStateException "
                    + "as expected.");
        }
        Object res = pti.next();

        if (res != obj) {
            // FAIL
            throw new TestException(
                    "First 'next' method invocation of constructed "
                    + "SingletonProxyTrustIterator returned " + res
                    + " while " + obj + " was expected.");
        }

        // PASS
        logger.fine("First 'next' method invocation of constructed "
                + "SingletonProxyTrustIterator returned " + obj
                + " as expected.");
        pti.setException(re);

        // PASS
        logger.fine("'setExcepion' method invocation of constructed "
                + "SingletonProxyTrustIterator after it's 'next' "
                + "method invocation did not throw any exception "
                + "as expected.");

        try {
            pti.setException(re);

            // FAIL
            throw new TestException(
                    "2-nd 'setExcepion' method invocation of constructed "
                    + "SingletonProxyTrustIterator after it's 'next' "
                    + "method invocation did not throw any exception "
                    + "while IllegalStateException was expected.");
        } catch (IllegalStateException ise) {
            // PASS
            logger.fine("2-nd 'setExcepion' method invocation of "
                    + "constructed SingletonProxyTrustIterator after it's "
                    + "'next' method invocation threw "
                    + "IllegalStateException as expected.");
        }

        if (pti.hasNext()) {
            // FAIL
            throw new TestException(
                    "2-nd 'hasNext' method invocation of constructed "
                    + "SingletonProxyTrustIterator returned true while "
                    + "false was expected");
        }

        // PASS
        logger.fine("2-nd 'hasNext' method invocation of constructed "
                + "SingletonProxyTrustIterator returned false as expected");

        try {
            res = pti.next();

            // FAIL
            throw new TestException(
                    "2-nd 'next' method invocation of constructed "
                    + "SingletonProxyTrustIterator did not throw any "
                    + "exception while NoSuchElementException was "
                    + "expected.");
        } catch (NoSuchElementException nsee) {
            // PASS
            logger.fine("2-nd 'next' method invocation of constructed "
                    + "SingletonProxyTrustIterator threw "
                    + "NoSuchElementException as expected.");
        }
        pti = new SingletonProxyTrustIterator(obj);
        logger.fine("Constructed SingletonProxyTrustIterator(" + obj
                + ") again.");
        pti.next();
        pti.hasNext();
View Full Code Here


   * Returns a proxy trust iterator that is used in
         * <code>ProxyTrustVerifier</code> to retrieve this object's
         * trust verifier.
         */
        private ProxyTrustIterator getProxyTrustIterator() {
      return new SingletonProxyTrustIterator(server);
        }//end getProxyTrustIterator
View Full Code Here

     * Returns a proxy trust iterator that is used in
     * <code>ProxyTrustVerifier</code> to retrieve this object's
     * trust verifier.
     */
    private ProxyTrustIterator getProxyTrustIterator() {
  return new SingletonProxyTrustIterator(admin);
    }
View Full Code Here

  /*
   * Provide access to the underlying server proxy to permit the
   * ProxyTrustVerifier class to verify the proxy.
   */
  private ProxyTrustIterator getProxyTrustIterator() {
      return new SingletonProxyTrustIterator(serverProxy);
  }
View Full Code Here

        /** Returns a proxy trust iterator that is used in
         *  <code>ProxyTrustVerifier</code> to retrieve this object's
         *  trust verifier.
         */
        private ProxyTrustIterator getProxyTrustIterator() {
      return new SingletonProxyTrustIterator(server);
        }//end getProxyTrustIterator
View Full Code Here

         * Returns a proxy trust iterator that is used in
         * <code>ProxyTrustVerifier</code> to retrieve this object's
         * trust verifier.
         */
        private ProxyTrustIterator getProxyTrustIterator() {
            return new SingletonProxyTrustIterator(server);
        }//end getProxyTrustIterator
View Full Code Here

         * Returns a proxy trust iterator that is used in
         * <code>ProxyTrustVerifier</code> to retrieve this object's
         * trust verifier.
         */
        private ProxyTrustIterator getProxyTrustIterator() {
            return new SingletonProxyTrustIterator(mailbox);
        }//end getProxyTrustIterator
View Full Code Here

         * Returns a proxy trust iterator that is used in
         * <code>ProxyTrustVerifier</code> to retrieve this object's
         * trust verifier.
         */
        private ProxyTrustIterator getProxyTrustIterator() {
            return new SingletonProxyTrustIterator(mailbox);
        }//end getProxyTrustIterator
View Full Code Here

    /**
     * Returns iterator used by ProxyTrustVerifier to retrieve a trust verifier
     * for this object.
     */
    private ProxyTrustIterator getProxyTrustIterator() {
  return new SingletonProxyTrustIterator(server);
    }
View Full Code Here

    /**
     * Returns iterator used by ProxyTrustVerifier to retrieve a trust verifier
     * for this object.
     */
    private ProxyTrustIterator getProxyTrustIterator() {
  return new SingletonProxyTrustIterator(server);
    }
View Full Code Here

TOP

Related Classes of net.jini.security.proxytrust.SingletonProxyTrustIterator

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.