public class PermissionTest extends BaseMetaTest {
@Test
public void testGetPermissions() throws Exception {
IPermissionService permissionService = getPermissionService();
assertEquals(permissionService.getPermissions("com.jresearchsoft.flexess.examples.orders").size(), 3); //$NON-NLS-1$
IPermissionMetaInfo perm1 = permissionService.findPermission("com.jresearchsoft.flexess.examples.orders", "ManageCustomerOrder"); //$NON-NLS-1$ //$NON-NLS-2$
assertNotNull(perm1);
IPermissionMetaInfo perm2 = permissionService.findPermission("com.jresearchsoft.flexess.examples.orders", "ManagePersonalOrders"); //$NON-NLS-1$ //$NON-NLS-2$
assertNotNull(perm2);
perm1 = permissionService.getPermission("com.jresearchsoft.flexess.examples.orders", "_KBjlgMm3Edu14qXh2kkVDA"); //$NON-NLS-1$ //$NON-NLS-2$
assertNotNull(perm1);
assertEquals(perm1.getModelId(), "com.jresearchsoft.flexess.examples.orders"); //$NON-NLS-1$
assertNotNull(perm1.getConstraint());
assertEquals(perm1.getAttributes().size(), 1);
IAttributeMetaInfo am1 = perm1.getAttribute("region"); //$NON-NLS-1$
assertEquals(am1.getName(), "region"); //$NON-NLS-1$
assertEquals(am1.getType(), EcorePackage.eINSTANCE.getEString().getClassifierID());
assertEquals(am1.getTypeDescription(), "String"); //$NON-NLS-1$
perm2 = permissionService.getPermission("com.jresearchsoft.flexess.examples.orders", "_JLNSMMr9Eduhuu4mIe0M6A"); //$NON-NLS-1$ //$NON-NLS-2$
assertNotNull(perm2);
assertEquals(perm1.getOperationDescriptions().size(), 3);
IAttributeMetaInfo am2 = perm2.getAttribute("uid"); //$NON-NLS-1$