Code example for SocketPermission

0
     
    /** 
     * @tests serialization/deserialization. 
     */ 
    public void testSerializationSelf() throws Exception { 
        SocketPermission permission = new SocketPermission("harmony.apache.org", "connect");;
 
        SerializationTest.verifySelf(permission);
    } 
     
    public void test_ConstructorLjava_lang_StringLjava_lang_String_subtestIPv6() { 
        String[] goodTestStrings = { 
                "12334.0.0.01", "[fe80::1]", 
                "[FE80:0000:0000:0000:0000:0000:0000:0001]:80", 
                "[::ffff]:80-82", "[ffff::]:80-82", "[fe80::1]:80", 
                "FE80:0000:0000:0000:0000:0000:0000:0001", 
                "FE80:0000:0000:0000:0000:0000:0000:0001:80" 
        }; 
        String[] badTestStrings = {"someName:withColonInit:80", "fg80::1", "[ffff:::80-82]",
                ":[:fff]:80", "FE80:0000:0000:0000:0000:0000:0000:0001:80:82", "FE80::1" 
        };