Examples of AuthActionPattern


Examples of com.alibaba.citrus.turbine.auth.impl.AuthActionPattern

public class AuthActionPatternTests {
    private AuthActionPattern pattern;

    @Test(expected = IllegalArgumentException.class)
    public void create_noname1() {
        new AuthActionPattern(null);
    }
View Full Code Here

Examples of com.alibaba.citrus.turbine.auth.impl.AuthActionPattern

        new AuthActionPattern(null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void create_noname2() {
        new AuthActionPattern(" ");
    }
View Full Code Here

Examples of com.alibaba.citrus.turbine.auth.impl.AuthActionPattern

        new AuthActionPattern(" ");
    }

    @Test
    public void getPatternName() {
        pattern = new AuthActionPattern("test");
        assertEquals("test", pattern.getPatternName());
    }
View Full Code Here

Examples of com.alibaba.citrus.turbine.auth.impl.AuthActionPattern

    }

    @Test
    public void getPattern() {
        // relative path
        pattern = new AuthActionPattern("test");

        assertMatches(false, "a.b.test");
        assertMatches(false, "a.test.");
        assertMatches(false, "a.test.b");
        assertMatches(true, "test");
        assertMatches(true, "test.");
        assertMatches(true, "test.b");

        assertMatches(false, "atest");
        assertMatches(false, "testb");
        assertMatches(false, "atestb");

        // abs path
        pattern = new AuthActionPattern("t.est");

        assertMatches(false, "a.b.t.est");
        assertMatches(false, "a.t.est.");
        assertMatches(false, "a.t.est.b");
        assertMatches(true, "t.est");
        assertMatches(true, "t.est.");
        assertMatches(true, "t.est.b");

        assertMatches(false, "at.est");
        assertMatches(false, "t.estb");
        assertMatches(false, "at.estb");

        // root path
        pattern = new AuthActionPattern(".");

        assertMatches(true, null);
        assertMatches(true, " ");
        assertMatches(true, " .");
    }
View Full Code Here

Examples of com.alibaba.citrus.turbine.auth.impl.AuthActionPattern

        }
    }

    @Test
    public void equalsAndHashCode() {
        AuthPattern p1 = new AuthActionPattern("test");
        AuthPattern p2 = new AuthActionPattern("test");
        AuthPattern p3 = new AuthActionPattern("*.test");

        assertEquals(p1, p1);
        assertEquals(p1, p2);
        assertFalse(p1.equals(p3));
        assertFalse(p1.equals(null));
        assertFalse(p1.equals("test"));

        assertEquals(p1.hashCode(), p2.hashCode());
        assertFalse(p1.hashCode() == p3.hashCode());
    }
View Full Code Here

Examples of com.alibaba.citrus.turbine.auth.impl.AuthActionPattern

        assertFalse(p1.hashCode() == p3.hashCode());
    }

    @Test
    public void toString_() {
        assertEquals("test", new AuthActionPattern(" test ").toString());
    }
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.