Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjphillips2010-07-08 16:18:50 -0400
committerjphillips2010-07-08 16:18:50 -0400
commitd41bba4b6e5632f4f0f3bda6684c3e43ffc2cafc (patch)
treee798f894007dc6ef779b16206fba57d4860dfc88 /plugins/org.eclipse.osee.framework.access.test
parent41a409793d3852fa74f07365dd7221bd2e43f424 (diff)
downloadorg.eclipse.osee-d41bba4b6e5632f4f0f3bda6684c3e43ffc2cafc.tar.gz
org.eclipse.osee-d41bba4b6e5632f4f0f3bda6684c3e43ffc2cafc.tar.xz
org.eclipse.osee-d41bba4b6e5632f4f0f3bda6684c3e43ffc2cafc.zip
Added permissionEnum unit test
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/PermissionEnumTest.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/PermissionEnumTest.java b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/PermissionEnumTest.java
new file mode 100644
index 0000000000..331fea4311
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/PermissionEnumTest.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.access.test.internal;
+
+import org.eclipse.osee.framework.core.enums.PermissionEnum;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Test Case for {@link PermissionEnum}
+ *
+ * @author Jeff C. Phillips
+ */
+public class PermissionEnumTest {
+
+ @Test
+ public void testPermissions() {
+ PermissionEnum read = PermissionEnum.READ;
+ PermissionEnum write = PermissionEnum.WRITE;
+ PermissionEnum deny = PermissionEnum.DENY;
+ PermissionEnum full = PermissionEnum.FULLACCESS;
+
+ Assert.assertTrue(full.matches(full));
+ Assert.assertTrue(read.matches(read));
+ Assert.assertTrue(write.matches(read));
+ Assert.assertTrue(full.matches(write));
+
+ //deny always returns false for a permission
+ Assert.assertFalse(deny.matches(deny));
+ Assert.assertFalse(deny.matches(write));
+ Assert.assertFalse(read.matches(write));
+ Assert.assertFalse(write.matches(full));
+ }
+}

Back to the top