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());
}
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());
}
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()));
}
Aggregations