urbanairship-core/src/test/java/com/urbanairship/js/WhitelistTest.java
@Test
    public void testSchemeWildCard() {
        assertTrue(whitelist.addEntry("*://www.urbanairship.com"));
        assertTrue(whitelist.addEntry("cool*story://rad"));

        // Reject
        assertFalse(whitelist.isWhitelisted(null, Whitelist.SCOPE_ALL));
        assertFalse(whitelist.isWhitelisted("", Whitelist.SCOPE_ALL));
        assertFalse(whitelist.isWhitelisted("urbanairship.com", Whitelist.SCOPE_ALL));
        assertFalse(whitelist.isWhitelisted("www.urbanairship.com", Whitelist.SCOPE_ALL));
        assertFalse(whitelist.isWhitelisted("cool://rad", Whitelist.SCOPE_ALL));

        // Accept
        assertTrue(whitelist.isWhitelisted("https://www.urbanairship.com", Whitelist.SCOPE_ALL));
        assertTrue(whitelist.isWhitelisted("http://www.urbanairship.com", Whitelist.SCOPE_ALL));
        assertTrue(whitelist.isWhitelisted("file://www.urbanairship.com", Whitelist.SCOPE_ALL));
        assertTrue(whitelist.isWhitelisted("valid://www.urbanairship.com", Whitelist.SCOPE_ALL));
        assertTrue(whitelist.isWhitelisted("cool----story://rad", Whitelist.SCOPE_ALL));
        assertTrue(whitelist.isWhitelisted("coolstory://rad", Whitelist.SCOPE_ALL));
    }
/**
     * Test wild card scheme with wild cards.
     */
Test wild card scheme with wild cards.
Test wild card scheme with wild cards .
@Test
    public void testSchemeWildCard() {
        assertTrue(whitelist.addEntry("*://www.urbanairship.com"));
        assertTrue(whitelist.addEntry("cool*story://rad"));
        assertFalse(whitelist.isWhitelisted(null, Whitelist.SCOPE_ALL));
        assertFalse(whitelist.isWhitelisted("", Whitelist.SCOPE_ALL));
        assertFalse(whitelist.isWhitelisted("urbanairship.com", Whitelist.SCOPE_ALL));
        assertFalse(whitelist.isWhitelisted("www.urbanairship.com", Whitelist.SCOPE_ALL));
        assertFalse(whitelist.isWhitelisted("cool://rad", Whitelist.SCOPE_ALL));
        assertTrue(whitelist.isWhitelisted("https://www.urbanairship.com", Whitelist.SCOPE_ALL));
        assertTrue(whitelist.isWhitelisted("http://www.urbanairship.com", Whitelist.SCOPE_ALL));
        assertTrue(whitelist.isWhitelisted("file://www.urbanairship.com", Whitelist.SCOPE_ALL));
        assertTrue(whitelist.isWhitelisted("valid://www.urbanairship.com", Whitelist.SCOPE_ALL));
        assertTrue(whitelist.isWhitelisted("cool----story://rad", Whitelist.SCOPE_ALL));
        assertTrue(whitelist.isWhitelisted("coolstory://rad", Whitelist.SCOPE_ALL));
    }
@ Test public void testSchemeWildCard ( ) { assertTrue ( whitelist . addEntry ( "*://www.urbanairship.com" ) ) ; assertTrue ( whitelist . addEntry ( "cool*story://rad" ) ) ; assertFalse ( whitelist . isWhitelisted ( null , Whitelist . SCOPE_ALL ) ) ; assertFalse ( whitelist . isWhitelisted ( "" , Whitelist . SCOPE_ALL ) ) ; assertFalse ( whitelist . isWhitelisted ( "urbanairship.com" , Whitelist . SCOPE_ALL ) ) ; assertFalse ( whitelist . isWhitelisted ( "www.urbanairship.com" , Whitelist . SCOPE_ALL ) ) ; assertFalse ( whitelist . isWhitelisted ( "cool://rad" , Whitelist . SCOPE_ALL ) ) ; assertTrue ( whitelist . isWhitelisted ( "https://www.urbanairship.com" , Whitelist . SCOPE_ALL ) ) ; assertTrue ( whitelist . isWhitelisted ( "http://www.urbanairship.com" , Whitelist . SCOPE_ALL ) ) ; assertTrue ( whitelist . isWhitelisted ( "file://www.urbanairship.com" , Whitelist . SCOPE_ALL ) ) ; assertTrue ( whitelist . isWhitelisted ( "valid://www.urbanairship.com" , Whitelist . SCOPE_ALL ) ) ; assertTrue ( whitelist . isWhitelisted ( "cool----story://rad" , Whitelist . SCOPE_ALL ) ) ; assertTrue ( whitelist . isWhitelisted ( "coolstory://rad" , Whitelist . SCOPE_ALL ) ) ; }
Test wild card scheme with wild cards.
Test wild card scheme with wild cards .
// Reject // Accept