FileDocCategorySizeDatePackage
FilePermissionTest.javaAPI DocAndroid 1.5 API1957Wed May 06 22:41:04 BST 2009org.apache.harmony.luni.tests.java.io

FilePermissionTest

public class FilePermissionTest extends TestCase

Fields Summary
Constructors Summary
Methods Summary
public voidtest_impliesLjava_io_FilePermission()

tests
java.io.FilePermission#implies(java.security.Permission)

        // Regression for HARMONY-47
        char separator = File.separatorChar;
        char nonSeparator = (separator == '/") ? '\\" : '/";

        FilePermission fp1 = new FilePermission(nonSeparator + "*", "read");
        FilePermission fp2 = new FilePermission(separator + "a", "read");
        assertFalse("Assert 0: non-separator worked", fp1.implies(fp2));
        fp1 = new FilePermission(nonSeparator + "-", "read");
        assertFalse("Assert 1: non-separator worked", fp1.implies(fp2));