Package net.jini.core.constraint

Examples of net.jini.core.constraint.DelegationRelativeTime


                                                            maxStopDate);
                } else if (constructorType == DELEGATION_ABSOLUTE_TIME__LONG) {
                    constraint = new DelegationAbsoluteTime(minStart, maxStart,
                                                            minStop, maxStop);
                } else if (constructorType == DELEGATION_RELATIVE_TIME__LONG) {
                    constraint = new DelegationRelativeTime(minStart, maxStart,
                                                            minStop, maxStop);
                }
                logger.log(Level.INFO, "Created constraint: " + constraint);
            } catch (Exception e) {
                logger.log(Level.FINE,
View Full Code Here


            Delegation.NO,
            Integrity.NO,
            ServerAuthentication.NO,
            new ClientMaxPrincipalType(TestPrincipal.class),
            new ClientMinPrincipalType(TestPrincipal.class),
            new DelegationRelativeTime(1000, 2000, 3000, 4000),
            new DelegationAbsoluteTime(1000, 2000, 3000, 4000),
            new ClientMinPrincipal(new Principal[] { tp1, tp2 }),
            new ClientMaxPrincipal(new Principal[] { tp1, tp2 }),
            new ServerMinPrincipal(new Principal[] { tp1, tp2 }),
            new ClientMinPrincipal(new Principal[] { tp1, tp3, tp2 }),
View Full Code Here

        logger.log(Level.FINE,
                "\n\t+++++ TestCase #19:: "
                + "Only duplicate DelegationRelativeTime constraints exist");
        {
            Collection argColl = new ArrayList();
            DelegationRelativeTime ic = new DelegationRelativeTime((long) 0,
                    (long) 0, (long) 0, (long) 0);
            argColl.add(ic);
            argColl.add(ic);

            if (!checker(argColl, ic)) {
                throw new TestException(
                        "" + " test failed");
            }
        }

        // TestCase #20
        logger.log(Level.FINE,
                "\n\t+++++ TestCase #20:: "
                + "There are several duplicate and non-duplicate constraints");

        try {
            // Argument for ConstraintAlternatives.create() methods
            Collection argColl = new ArrayList();
            argColl.add(ClientAuthentication.YES);
            argColl.add(ClientAuthentication.YES);
            argColl.add(ClientAuthentication.NO);
            argColl.add(Confidentiality.YES);
            argColl.add(Confidentiality.YES);
            argColl.add(Confidentiality.NO);
            argColl.add(Delegation.YES);
            argColl.add(Delegation.YES);
            argColl.add(Delegation.NO);
            argColl.add(Integrity.YES);
            argColl.add(Integrity.YES);
            argColl.add(Integrity.NO);
            argColl.add(ServerAuthentication.YES);
            argColl.add(ServerAuthentication.YES);
            argColl.add(ServerAuthentication.NO);
            argColl.add(new ClientMaxPrincipal(new
                    KerberosPrincipal("duke@FOO.COM")));
            argColl.add(new ClientMaxPrincipal(new
                    KerberosPrincipal("duke@FOO.COM")));
            argColl.add(new ClientMaxPrincipal(new
                    X500Principal(
                    "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
            argColl.add(new ClientMaxPrincipalType(KerberosPrincipal.class));
            argColl.add(new ClientMaxPrincipalType(KerberosPrincipal.class));
            argColl.add(new ClientMaxPrincipalType(X500Principal.class));
            argColl.add(new ClientMinPrincipal(new
                    KerberosPrincipal("duke@FOO.COM")));
            argColl.add(new ClientMinPrincipal(new
                    KerberosPrincipal("duke@FOO.COM")));
            argColl.add(new ClientMinPrincipal(new
                    X500Principal(
                    "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
            argColl.add(new ClientMinPrincipalType(KerberosPrincipal.class));
            argColl.add(new ClientMinPrincipalType(KerberosPrincipal.class));
            argColl.add(new ClientMinPrincipalType(X500Principal.class));
            argColl.add(new ServerMinPrincipal(new
                    KerberosPrincipal("duke@FOO.COM")));
            argColl.add(new ServerMinPrincipal(new
                    KerberosPrincipal("duke@FOO.COM")));
            argColl.add(new ServerMinPrincipal(new
                    X500Principal(
                    "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
            argColl.add(new ConnectionAbsoluteTime((long) 0));
            argColl.add(new ConnectionAbsoluteTime((long) 0));
            argColl.add(new ConnectionAbsoluteTime((long) 1));
            argColl.add(new ConnectionRelativeTime((long) 0));
            argColl.add(new ConnectionRelativeTime((long) 0));
            argColl.add(new ConnectionRelativeTime((long) 1));
            argColl.add(new DelegationAbsoluteTime((long) 0, (long) 0, (long) 0,
                    (long) 0));
            argColl.add(new DelegationAbsoluteTime((long) 0, (long) 0, (long) 0,
                    (long) 0));
            argColl.add(new DelegationAbsoluteTime((long) 1, (long) 1, (long) 1,
                    (long) 1));
            argColl.add(new DelegationRelativeTime((long) 0, (long) 0, (long) 0,
                    (long) 0));
            argColl.add(new DelegationRelativeTime((long) 0, (long) 0, (long) 0,
                    (long) 0));
            argColl.add(new DelegationRelativeTime((long) 1, (long) 1, (long) 1,
                    (long) 1));

            // Expected result of ConstraintAlternatives.create() methods
            Collection expColl = new ArrayList();
            expColl.add(ClientAuthentication.YES);
            expColl.add(ClientAuthentication.NO);
            expColl.add(Confidentiality.YES);
            expColl.add(Confidentiality.NO);
            expColl.add(Delegation.YES);
            expColl.add(Delegation.NO);
            expColl.add(Integrity.YES);
            expColl.add(Integrity.NO);
            expColl.add(ServerAuthentication.YES);
            expColl.add(ServerAuthentication.NO);
            expColl.add(new ClientMaxPrincipal(new
                    KerberosPrincipal("duke@FOO.COM")));
            expColl.add(new ClientMaxPrincipal(new
                    X500Principal(
                    "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
            expColl.add(new ClientMaxPrincipalType(KerberosPrincipal.class));
            expColl.add(new ClientMaxPrincipalType(X500Principal.class));
            expColl.add(new ClientMinPrincipal(new
                    KerberosPrincipal("duke@FOO.COM")));
            expColl.add(new ClientMinPrincipal(new
                    X500Principal(
                    "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
            expColl.add(new ClientMinPrincipalType(KerberosPrincipal.class));
            expColl.add(new ClientMinPrincipalType(X500Principal.class));
            expColl.add(new ServerMinPrincipal(new
                    KerberosPrincipal("duke@FOO.COM")));
            expColl.add(new ServerMinPrincipal(new
                    X500Principal(
                    "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US")));
            expColl.add(new ConnectionAbsoluteTime((long) 0));
            expColl.add(new ConnectionAbsoluteTime((long) 1));
            expColl.add(new ConnectionRelativeTime((long) 0));
            expColl.add(new ConnectionRelativeTime((long) 1));
            expColl.add(new DelegationAbsoluteTime((long) 0, (long) 0, (long) 0,
                    (long) 0));
            expColl.add(new DelegationAbsoluteTime((long) 1, (long) 1, (long) 1,
                    (long) 1));
            expColl.add(new DelegationRelativeTime((long) 0, (long) 0, (long) 0,
                    (long) 0));
            expColl.add(new DelegationRelativeTime((long) 1, (long) 1, (long) 1,
                    (long) 1));

            if (!checker(argColl, new ConstraintAlternatives(expColl))) {
                throw new TestException(
                        "" + " test failed");
View Full Code Here

                                                            maxStopDate);
                } else if (constructorType == DELEGATION_ABSOLUTE_TIME__LONG) {
                    constraint = new DelegationAbsoluteTime(minStart, maxStart,
                                                            minStop, maxStop);
                } else if (constructorType == DELEGATION_RELATIVE_TIME__LONG) {
                    constraint = new DelegationRelativeTime(minStart, maxStart,
                                                            minStop, maxStop);
                }
                logger.log(Level.INFO, "Created constraint: " + constraint);
            } catch (Exception e) {
                logger.log(Level.FINE,
View Full Code Here

        logger.log(Level.FINE,
                "\n\t+++++ TestCase #12:"
                + "  net.jini.core.constraint.DelegationRelativeTime");

        try {
            DelegationRelativeTime obj1 = new
                    DelegationRelativeTime(Long.MAX_VALUE, Long.MAX_VALUE,
                    Long.MAX_VALUE, Long.MAX_VALUE);
            DelegationRelativeTime obj2 = new
                    DelegationRelativeTime(Long.MAX_VALUE, Long.MAX_VALUE,
                    Long.MAX_VALUE, Long.MAX_VALUE);
            DelegationRelativeTime obj3 = new DelegationRelativeTime((long) 0,
                    (long) 0, (long) 0, (long) 0);

            if (!checker(obj1, obj2, obj3)) {
                throw new TestException(
                        "" + " test failed");
View Full Code Here

TOP

Related Classes of net.jini.core.constraint.DelegationRelativeTime

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.