Examples of TestPrincipal


Examples of com.sun.jini.test.spec.constraint.util.TestPrincipal

        TrustVerifier.Context falseTvc = new FalseTrustVerifierContext();
        TrustVerifier.Context trueTvc = new TrueTrustVerifierContext();
        TrustVerifier.Context prinTvc = new PrincipalTrustVerifierContext();
        TrustVerifier.Context conTvc = new ConstraintTrustVerifierContext();
        TrustVerifier.Context icTvc = new ICTrustVerifierContext();
        TestPrincipal tp1 = new TestPrincipal("true TP", true);
        TestPrincipal tp2 = new TestPrincipal("true TP1", true);
        TestPrincipal tp3 = new TestPrincipal("false TP", false);
        BasicMethodConstraints.MethodDesc md1 =
                new BasicMethodConstraints.MethodDesc("Foo",
                    new InvocationConstraints(
                        new InvocationConstraint[] {
                            ClientAuthentication.YES,
                            Delegation.YES }, null));
        BasicMethodConstraints.MethodDesc md2 =
                new BasicMethodConstraints.MethodDesc("Foo1",
                    new InvocationConstraints(
                        new InvocationConstraint[] {
                            ClientAuthentication.YES,
                            Integrity.YES }, null));
        BasicMethodConstraints.MethodDesc md3 =
                new BasicMethodConstraints.MethodDesc("Foo2",
                    new InvocationConstraints(
                        new InvocationConstraint[] {
                            ClientAuthentication.YES,
                            Confidentiality.YES,
                            Delegation.YES }, null));
        Object[] testObjs = new Object[] {
            ClientAuthentication.YES,
            Confidentiality.YES,
            Delegation.YES,
            Integrity.YES,
            ServerAuthentication.YES,
            ClientAuthentication.NO,
            Confidentiality.NO,
            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 }),
            new ClientMaxPrincipal(new Principal[] { tp1, tp3, tp2 }),
            new ServerMinPrincipal(new Principal[] { tp1, tp3, tp2 }),
            new ConstraintAlternatives(new InvocationConstraint[] {
                Delegation.YES,
                Integrity.YES,
                ClientAuthentication.YES }),
            new ConstraintAlternatives(new InvocationConstraint[] {
                Delegation.YES,
                Confidentiality.YES,
                ClientAuthentication.YES }),
            new BasicMethodConstraints(
                    new BasicMethodConstraints.MethodDesc[] { md1, md2 }),
            new BasicMethodConstraints(
                    new BasicMethodConstraints.MethodDesc[] { md1, md3, md2 }),
            new InvocationConstraints(
                new InvocationConstraint[] {
                    ClientAuthentication.YES, Delegation.YES },
                new InvocationConstraint[] {
                    Integrity.YES, ServerAuthentication.YES }),
            new InvocationConstraints(
                new InvocationConstraint[] {
                    ClientAuthentication.YES, Delegation.YES },
                new InvocationConstraint[] {
                    Integrity.YES, Confidentiality.YES,
                    ServerAuthentication.YES }),
            new InvocationConstraints(
                new InvocationConstraint[] {
                    ClientAuthentication.YES, Confidentiality.YES,
                    Delegation.YES },
                new InvocationConstraint[] {
                    Integrity.YES, ServerAuthentication.YES }),
            new X500Principal("CN=Test, OU=JINI, O=Sun Microsystems, C=US"),
            new KerberosPrincipal("Test@test.com"),
            new TestPrincipal("TEST", true),
            new TestConstraint()
        };
        TrustVerifier.Context[] testCtxs = new TrustVerifier.Context[] {
            falseTvc, falseTvc, falseTvc, falseTvc, falseTvc, falseTvc,
            falseTvc, falseTvc, falseTvc, falseTvc, falseTvc, falseTvc,
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

    public void testMultipleGroupPermissionsOnNode() throws NotExecutableException, RepositoryException {
        Group testGroup = getTestGroup();

        /* create a second group the test user is member of */
        Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
        UserManager umgr = getUserManager(superuser);
        Group group2 = umgr.createGroup(principal);
        try {
            group2.addMember(testUser);
            if (!umgr.isAutoSave() && superuser.hasPendingChanges()) {
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

    public void testMultipleGroupPermissionsOnNode2() throws NotExecutableException, RepositoryException {
        Group testGroup = getTestGroup();

        /* create a second group the test user is member of */
        Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
        UserManager umgr = getUserManager(superuser);
        Group group2 = umgr.createGroup(principal);

        try {
            group2.addMember(testUser);
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

    public void testReorderGroupPermissions() throws NotExecutableException, RepositoryException {
        Group testGroup = getTestGroup();

        /* create a second group the test user is member of */
        Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
        UserManager umgr = getUserManager(superuser);
        Group group2 = umgr.createGroup(principal);

        try {
            group2.addMember(testUser);
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

    }

    protected Group getTestGroup() throws RepositoryException, NotExecutableException {
        if (testGroup == null) {
            // create the testGroup
            Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
            UserManager umgr = getUserManager(superuser);
            testGroup = umgr.createGroup(principal);
            testGroup.addMember(testUser);
            if (!umgr.isAutoSave() && superuser.hasPendingChanges()) {
                superuser.save();
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

        User u = null;
        Group gr = null;
        try {
            u = userMgr.createUser(uid, buildPassword(uid, true), p, null);
            save(superuser);
            gr = userMgr.createGroup(new TestPrincipal(uid));
            save(superuser);

            String msg = "Creating a Group with a principal-name that exists as UserID -> must create new GroupID but keep PrincipalName.";
            assertFalse(msg, gr.getID().equals(gr.getPrincipal().getName()));
            assertFalse(msg, gr.getID().equals(uid));
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

        User u = null;
        Group gr = null;
        try {
            u = userMgr.createUser(uid, buildPassword(uid), p, null);
            save(superuser);
            gr = userMgr.createGroup(new TestPrincipal(uid));
            save(superuser);

            String msg = "Creating a Group with a principal-name that exists as UserID -> must create new GroupID but keep PrincipalName.";
            assertFalse(msg, gr.getID().equals(gr.getPrincipal().getName()));
            assertFalse(msg, gr.getID().equals(uid));
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

     * @throws Exception
     */
    public void testCacheDoesntContainTestPrincipalImpl() throws Exception {
        Set<Principal> principals = getPrincipalSetFromSession(superuser);
        for (Principal p : principals) {
            Principal testPrinc = new TestPrincipal(p.getName());
            principalProvider.getGroupMembership(testPrinc);
            Principal fromProvider = principalProvider.getPrincipal(p.getName());

            assertNotSame(testPrinc, fromProvider);
            assertFalse(fromProvider instanceof TestPrincipal);
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

        try {
            UserManager uMgr = getUserManager(superuser);

            u = uMgr.createUser("t", "t");
            u2 = uMgr.createUser("tt", "tt", new TestPrincipal("tt"), "t/tt");

            Principal p = u.getPrincipal();
            Principal p2 = u2.getPrincipal();

            if (p instanceof ItemBasedPrincipal && p2 instanceof ItemBasedPrincipal &&
View Full Code Here

Examples of org.apache.jackrabbit.core.security.TestPrincipal

        User u = null;
        Group gr = null;
        try {
            u = userMgr.createUser(uid, buildPassword(uid, true), p, null);
            gr = userMgr.createGroup(new TestPrincipal(uid));

            String msg = "Creating a Group with a principal-name that exists as UserID -> must create new GroupID but keep PrincipalName.";
            assertFalse(msg, gr.getID().equals(gr.getPrincipal().getName()));
            assertFalse(msg, gr.getID().equals(uid));
            assertFalse(msg, gr.getID().equals(u.getID()));
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.