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