MethodPermissionsMetaData permissions = md.getAssemblyDescriptor().getMethodPermissions()
.getMethodPermissionsByEjbName(implClass.getSimpleName());
TestCase.assertEquals(
"Only one set of " + MethodPermissionsMetaData.class.getSimpleName() + " should be defined", 1, permissions
.size());
MethodPermissionMetaData permission = permissions.get(0);
TestCase.assertNotNull(permission);
// Ensure we've got the right method associated w/ the permission
MethodsMetaData methods = permission.getMethods();
TestCase.assertEquals(1, methods.size());
MethodMetaData method = methods.get(0);
TestCase.assertNotNull(method);
String methodName = method.getMethodName();
String expectedMethodName = "someMethod";
TestCase.assertEquals(expectedMethodName, methodName);
// Ensure we've got the right role associated w/ the permission
Set<String> roles = permission.getRoles();
TestCase.assertEquals("Only one role was expected", 1, roles.size());
String role = roles.iterator().next();
TestCase.assertEquals(SecureService.ROLES_EJB, role);
}