Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjphillips2010-07-08 17:00:01 -0400
committerjphillips2010-07-08 17:00:01 -0400
commitb52013d80bf4f41fa8394df0cf544f988bcc2262 (patch)
tree24661db94e1481ed91e212d1c5399fe9080ade10 /plugins/org.eclipse.osee.framework.access.test
parentd41bba4b6e5632f4f0f3bda6684c3e43ffc2cafc (diff)
downloadorg.eclipse.osee-b52013d80bf4f41fa8394df0cf544f988bcc2262.tar.gz
org.eclipse.osee-b52013d80bf4f41fa8394df0cf544f988bcc2262.tar.xz
org.eclipse.osee-b52013d80bf4f41fa8394df0cf544f988bcc2262.zip
Added accessData merge
Diffstat (limited to 'plugins/org.eclipse.osee.framework.access.test')
-rw-r--r--plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/AccessDataTest.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/AccessDataTest.java b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/AccessDataTest.java
index 02d745b1677..4fd13cd9149 100644
--- a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/AccessDataTest.java
+++ b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/AccessDataTest.java
@@ -83,4 +83,36 @@ public class AccessDataTest {
Assert.assertTrue(accessData.getArtifactTypeMatches(basicArtifact, CoreArtifactTypes.AbstractSoftwareRequirement,
PermissionEnum.WRITE).isEmpty());
}
+
+ @Test
+ public void testMerge() {
+ AccessData mainAccessData = new AccessData();
+ AccessData subAccessData = new AccessData();
+
+ IBasicArtifact<?> basicArtifact = new DefaultBasicArtifact(1, "1", "Name");
+ mainAccessData.add(basicArtifact, CoreArtifactTypes.AbstractSoftwareRequirement, PermissionEnum.READ);
+ subAccessData.add(basicArtifact, CoreArtifactTypes.AbstractSoftwareRequirement, PermissionEnum.WRITE);
+ mainAccessData.merge(subAccessData);
+
+ Assert.assertTrue(!mainAccessData.getArtifactTypeMatches(basicArtifact,
+ CoreArtifactTypes.AbstractSoftwareRequirement, PermissionEnum.READ).isEmpty());
+
+ IBasicArtifact<?> basicArtifact2 = new DefaultBasicArtifact(2, "2", "NameTwo");
+ mainAccessData.add(basicArtifact2, CoreArtifactTypes.AbstractSoftwareRequirement, PermissionEnum.WRITE);
+ subAccessData.add(basicArtifact2, CoreArtifactTypes.AbstractSoftwareRequirement, PermissionEnum.READ);
+
+ mainAccessData.merge(subAccessData);
+
+ Assert.assertTrue(!mainAccessData.getArtifactTypeMatches(basicArtifact2,
+ CoreArtifactTypes.AbstractSoftwareRequirement, PermissionEnum.READ).isEmpty());
+
+ mainAccessData.add(basicArtifact2, CoreArtifactTypes.AbstractSoftwareRequirement, PermissionEnum.WRITE);
+ subAccessData.add(basicArtifact2, CoreArtifactTypes.AbstractSoftwareRequirement, PermissionEnum.DENY);
+
+ mainAccessData.merge(subAccessData);
+
+ Assert.assertFalse(!mainAccessData.getArtifactTypeMatches(basicArtifact2,
+ CoreArtifactTypes.AbstractSoftwareRequirement, PermissionEnum.READ).isEmpty());
+ }
+
}

Back to the top