Package javax.security.auth

Examples of javax.security.auth.SubjectDomainCombiner.combine()


        SubjectDomainCombiner combiner = new SubjectDomainCombiner(subject);

        ProtectionDomain[] pd;

        // test case: both parameters are null
        assertNull(combiner.combine(null, null));

        // test case: check assigned principals
        URL url = new URL("file://foo.txt");

        CodeSource source = new CodeSource(url, (Certificate[]) null);
View Full Code Here


        Principal[] principals = new Principal[] { p };

        ProtectionDomain domain = new ProtectionDomain(source, permissions,
                classLoader, principals);

        pd = combiner.combine(new ProtectionDomain[] { domain }, null);

        assertSame("CodeSource", source, pd[0].getCodeSource());
        assertSame("PermissionCollection", permissions, pd[0]
                .getPermissions());
        assertSame("ClassLoader", classLoader, pd[0].getClassLoader());
View Full Code Here

        assertEquals("Size", 1, pd[0].getPrincipals().length);
        assertSame("Principal", principal, (pd[0].getPrincipals())[0]);

        // test case: check inherited domains
        pd = combiner.combine(null, new ProtectionDomain[] { domain });
        assertSame("Inherited domain", domain, pd[0]);

        //Regression for HARMONY-1129
        assertNotNull(new SubjectDomainCombiner(new Subject()).combine(new ProtectionDomain[] {null}, new ProtectionDomain[] {null}));
    }
View Full Code Here

        SubjectDomainCombiner combiner = new SubjectDomainCombiner(subject);

        ProtectionDomain[] pd;

        // test case: both parameters are null
        assertNull(combiner.combine(null, null));

        // test case: check assigned principals
        URL url = new URL("file://foo.txt");

        CodeSource source = new CodeSource(url, (Certificate[]) null);
View Full Code Here

        Principal[] principals = new Principal[] { p };

        ProtectionDomain domain = new ProtectionDomain(source, permissions,
                classLoader, principals);

        pd = combiner.combine(new ProtectionDomain[] { domain }, null);

        assertSame("CodeSource", source, pd[0].getCodeSource());
        assertSame("PermissionCollection", permissions, pd[0]
                .getPermissions());
        assertSame("ClassLoader", classLoader, pd[0].getClassLoader());
View Full Code Here

        assertEquals("Size", 1, pd[0].getPrincipals().length);
        assertSame("Principal", principal, (pd[0].getPrincipals())[0]);

        // test case: check inherited domains
        pd = combiner.combine(null, new ProtectionDomain[] { domain });
        assertSame("Inherited domain", domain, pd[0]);
    }

    public final void testSecurityException() {
View Full Code Here

        SubjectDomainCombiner combiner = new SubjectDomainCombiner(subject);

        ProtectionDomain[] pd;

        // test case: both parameters are null
        assertNull(combiner.combine(null, null));

        // test case: check assigned principals
        URL url = new URL("file://foo.txt");

        CodeSource source = new CodeSource(url, (Certificate[]) null);
View Full Code Here

        Principal[] principals = new Principal[] { p };

        ProtectionDomain domain = new ProtectionDomain(source, permissions,
                classLoader, principals);

        pd = combiner.combine(new ProtectionDomain[] { domain }, null);

        assertSame("CodeSource", source, pd[0].getCodeSource());
        assertSame("PermissionCollection", permissions, pd[0]
                .getPermissions());
        assertSame("ClassLoader", classLoader, pd[0].getClassLoader());
View Full Code Here

        assertEquals("Size", 1, pd[0].getPrincipals().length);
        assertSame("Principal", principal, (pd[0].getPrincipals())[0]);

        // test case: check inherited domains
        pd = combiner.combine(null, new ProtectionDomain[] { domain });
        assertSame("Inherited domain", domain, pd[0]);
    }

    public final void testSecurityException() {
View Full Code Here

        ProtectionDomain[] current = new ProtectionDomain[] {pd1, pd2};
        ProtectionDomain[] assigned = new ProtectionDomain[] {pd3, pd2};

        SubjectDomainCombiner sdc = new SubjectDomainCombiner(new Subject());
        ProtectionDomain[] combined = sdc.combine(current, assigned);

        // this depends on current SubjectDomainCombiner implementation
        // (ordering of returned domains)
        if (combined.length == 4 &&
            combined[0] != pd1 && combined[1] != pd2 &&
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.