Search in sources :

Example 1 with IdentityScopeStub

use of org.apache.harmony.security.tests.support.IdentityScopeStub in project robovm by robovm.

the class IdentityScopeTest method testIdentityScopeStringIdentityScope.

/**
     * check that void IdentityScope(String, IdentityScope) creates instance with given name and within given scope
     */
public final void testIdentityScopeStringIdentityScope() throws Exception {
    IdentityScope scope = new IdentityScopeStub("my scope");
    is = new IdentityScopeStub("Aleksei Semenov", scope);
    assertNotNull(is);
    assertEquals("Aleksei Semenov", is.getName());
    assertEquals(scope.getName(), is.getScope().getName());
}
Also used : IdentityScope(java.security.IdentityScope) IdentityScopeStub(org.apache.harmony.security.tests.support.IdentityScopeStub)

Example 2 with IdentityScopeStub

use of org.apache.harmony.security.tests.support.IdentityScopeStub in project robovm by robovm.

the class IdentityScopeTest method testSetSystemScope.

/**
     * check that if permission given - set/get works
     * if permission is denied than SecurityException is thrown
     *
     */
public final void testSetSystemScope() {
    //      default implementation is specified by security property system.scope
    IdentityScope systemScope = IdentityScope.getSystemScope();
    try {
        // all permissions are granted - sm is not installed
        is = new IdentityScopeStub("Aleksei Semenov");
        IdentityScopeStub.mySetSystemScope(is);
        assertSame(is, IdentityScope.getSystemScope());
    } finally {
        IdentityScopeStub.mySetSystemScope(systemScope);
    }
}
Also used : IdentityScope(java.security.IdentityScope) IdentityScopeStub(org.apache.harmony.security.tests.support.IdentityScopeStub)

Example 3 with IdentityScopeStub

use of org.apache.harmony.security.tests.support.IdentityScopeStub in project robovm by robovm.

the class IdentityScopeTest method testIdentityScopeString.

/**
     * check that void IdentityScope(String) creates instance with given name
     */
public final void testIdentityScopeString() {
    is = new IdentityScopeStub("Aleksei Semenov");
    assertNotNull(is);
    assertEquals("Aleksei Semenov", is.getName());
}
Also used : IdentityScopeStub(org.apache.harmony.security.tests.support.IdentityScopeStub)

Aggregations

IdentityScopeStub (org.apache.harmony.security.tests.support.IdentityScopeStub)3 IdentityScope (java.security.IdentityScope)2