super.testCode();
}
@Override
protected SecurityModel modifyModel(SecurityModel pack) {
Permission permission = null;
Collection<Permission> permissions = EcoreUtil.getObjectsByType(pack.getEClassifiers(), UamPackage.eINSTANCE.getPermission());
for (Permission object : permissions) {
if (object.getId().equals("test_permission")) { //$NON-NLS-1$
permission = object;
}
}
if (permission == null) {
throw new AssertionFailedError("No test permission defined"); //$NON-NLS-1$
}
EAttribute attr = (EAttribute) permission.getEStructuralFeature("attr2"); //$NON-NLS-1$
permission.getEStructuralFeatures().remove(attr);
attr = EcoreFactory.eINSTANCE.createEAttribute();
attr.setName("wwattr2"); //$NON-NLS-1$
EcoreUtil.setAnnotation(attr, UamPackage.eNS_URI, "#description", "test attr"); //$NON-NLS-1$ //$NON-NLS-2$
attr.setEType(EcorePackage.eINSTANCE.getEString());
attr.setDefaultValue("1"); //$NON-NLS-1$
permission.getEStructuralFeatures().add(attr);
return pack;
}