harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Zhou (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
Date Fri, 12 Dec 2008 06:28:44 GMT
[classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
----------------------------------------------------------------------------

                 Key: HARMONY-6043
                 URL: https://issues.apache.org/jira/browse/HARMONY-6043
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M8
            Reporter: Kevin Zhou
             Fix For: 5.0M9


Given a test case[1], RI works well while HARMONY fails.

[1] UnresolvedPermissionTest 
public class UnresolvedPermissionTest extends TestCase {
    public static final String type = "java.util.PropertyPermission";
    public static final String name = "os.name";
    public static final String action = "write,read";
    public void test_Scenario0() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                null);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                null);
        assertEquals(up1, up2);
    }

    public void test_Scenario1() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                null);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[0]);
        assertFalse(up1.equals(up2));
    }

    public void test_Scenario2() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                null);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[2]);
        assertFalse(up1.equals(up2));
    }

    public void test_Scenario3() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[0]);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[0]);
        assertEquals(up1, up2);
    }

    public void test_Scenario4() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[0]);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[2]);
        assertFalse(up1.equals(up2));
    }

    public void test_Scenario5() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[2]);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[2]);
        try {
            up1.equals(up2);
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // Expected
        }
    }

    public void test_Scenario6() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[2]);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[5]);
        assertFalse(up1.equals(up2));
    }
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message