urbanairship-core/src/test/java/com/urbanairship/js/WhitelistTest.java
@Test
    public void testInvalidPatterns() {
        // Not a URL
        assertFalse(whitelist.addEntry("not a url"));
        assertFalse(whitelist.addEntry(null));

        // Missing /
        assertFalse(whitelist.addEntry("*:*"));

        // Missing schemes
        assertFalse(whitelist.addEntry("www.urbanairship.com"));
        assertFalse(whitelist.addEntry("://www.urbanairship.com"));

        // White space in scheme
        assertFalse(whitelist.addEntry(" file://*"));

        // Invalid hosts
        assertFalse(whitelist.addEntry("*://what*"));
        assertFalse(whitelist.addEntry("*://*what"));

        // Missing host
        assertFalse(whitelist.addEntry("*://"));

        // Missing file path
        assertFalse(whitelist.addEntry("file://"));
    }
/**
     * Test setting invalid patterns returns false.
     */
Test setting invalid patterns returns false.
Test setting invalid patterns returns false .
@Test
    public void testInvalidPatterns() {
        assertFalse(whitelist.addEntry("not a url"));
        assertFalse(whitelist.addEntry(null));
        assertFalse(whitelist.addEntry("*:*"));
        assertFalse(whitelist.addEntry("www.urbanairship.com"));
        assertFalse(whitelist.addEntry("://www.urbanairship.com"));
        assertFalse(whitelist.addEntry(" file://*"));
        assertFalse(whitelist.addEntry("*://what*"));
        assertFalse(whitelist.addEntry("*://*what"));
        assertFalse(whitelist.addEntry("*://"));
        assertFalse(whitelist.addEntry("file://"));
    }
@ Test public void testInvalidPatterns ( ) { assertFalse ( whitelist . addEntry ( "not a url" ) ) ; assertFalse ( whitelist . addEntry ( null ) ) ; assertFalse ( whitelist . addEntry ( "*:*" ) ) ; assertFalse ( whitelist . addEntry ( "www.urbanairship.com" ) ) ; assertFalse ( whitelist . addEntry ( "://www.urbanairship.com" ) ) ; assertFalse ( whitelist . addEntry ( " file://*" ) ) ; assertFalse ( whitelist . addEntry ( "*://what*" ) ) ; assertFalse ( whitelist . addEntry ( "*://*what" ) ) ; assertFalse ( whitelist . addEntry ( "*://" ) ) ; assertFalse ( whitelist . addEntry ( "file://" ) ) ; }
Test setting invalid patterns returns false.
Test setting invalid patterns returns false .
// Not a URL // Missing / // Missing schemes // White space in scheme // Invalid hosts // Missing host // Missing file path