Search in sources :

Example 6 with IdentityScope

use of java.security.IdentityScope in project robovm by robovm.

the class IdentityScopeTest method testGetSystemScope.

/**
     * just call IdentityScope.getSystemScope()
     */
public final void testGetSystemScope() {
    String name = Security.getProperty("system.scope");
    assertNotNull(name);
    IdentityScope scope = IdentityScope.getSystemScope();
    assertNotNull(scope);
    assertEquals(name, scope.getClass().getName());
}
Also used : IdentityScope(java.security.IdentityScope)

Example 7 with IdentityScope

use of java.security.IdentityScope in project robovm by robovm.

the class IdentityTest method testGetScope.

/**
     * verify Identity.getScope() returns identity's scope
     */
public void testGetScope() throws Exception {
    Identity i = new IdentityStub("testGetScope");
    assertNull(i.getScope());
    IdentityScope s = IdentityScope.getSystemScope();
    Identity i2 = new IdentityStub("testGetScope2", s);
    assertSame(s, i2.getScope());
}
Also used : IdentityScope(java.security.IdentityScope) IdentityStub(org.apache.harmony.security.tests.support.IdentityStub) Identity(java.security.Identity)

Example 8 with IdentityScope

use of java.security.IdentityScope in project robovm by robovm.

the class IdentityTest method testIdentityStringIdentityScope.

/**
     * verify Identity(String, IdentityScope) creates instance with given name and in give scope
     */
public void testIdentityStringIdentityScope() throws Exception {
    IdentityScope s = IdentityScope.getSystemScope();
    Identity i = new IdentityStub("iii2", s);
    assertNotNull(i);
    assertEquals("iii2", i.getName());
    assertSame(s, i.getScope());
    assertSame(i, s.getIdentity(i.getName()));
}
Also used : IdentityScope(java.security.IdentityScope) IdentityStub(org.apache.harmony.security.tests.support.IdentityStub) Identity(java.security.Identity)

Aggregations

IdentityScope (java.security.IdentityScope)8 Identity (java.security.Identity)2 IdentityScopeStub (org.apache.harmony.security.tests.support.IdentityScopeStub)2 IdentityStub (org.apache.harmony.security.tests.support.IdentityStub)2 KeyManagementException (java.security.KeyManagementException)1 IdentityScopeSubclass (org.apache.harmony.security.tests.java.security.IdentityScope2Test.IdentityScopeSubclass)1