Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-08-10 15:52:06 -0400
committerddunne2010-08-10 15:52:06 -0400
commit347994a5a51e87e8512b9c29f349d419d0ab8b30 (patch)
treec0c16be622bcd966ca2fcea0e20f9244abc480e0 /plugins/org.eclipse.osee.framework.access.test
parentfbdb2f27fbcdb90b835553322483a7a5a38e5929 (diff)
downloadorg.eclipse.osee-347994a5a51e87e8512b9c29f349d419d0ab8b30.tar.gz
org.eclipse.osee-347994a5a51e87e8512b9c29f349d419d0ab8b30.tar.xz
org.eclipse.osee-347994a5a51e87e8512b9c29f349d419d0ab8b30.zip
CM changed to Cm
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/cm/CMAccessProviderTest.java99
-rw-r--r--plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CMAccessTestSuite.java25
2 files changed, 0 insertions, 124 deletions
diff --git a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CMAccessProviderTest.java b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CMAccessProviderTest.java
deleted file mode 100644
index 899e9431fd..0000000000
--- a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CMAccessProviderTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.cm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import org.eclipse.osee.framework.access.IAccessProvider;
-import org.eclipse.osee.framework.access.internal.cm.CmAccessProvider;
-import org.eclipse.osee.framework.access.test.mocks.MockCMWithAccessModel;
-import org.eclipse.osee.framework.access.test.mocks.MockConfigurationManagementProvider;
-import org.eclipse.osee.framework.core.data.AccessContextId;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
-import org.eclipse.osee.framework.core.model.access.AccessData;
-import org.eclipse.osee.framework.core.model.access.AccessModel;
-import org.eclipse.osee.framework.core.model.test.mocks.MockDataFactory;
-import org.eclipse.osee.framework.jdk.core.util.Compare;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test Case for {@link CmAccessProvider}
- *
- * @author Roberto E. Escobar
- */
-public class CmAccessProviderTest {
- private static IBasicArtifact<?> expectedUser;
- private static Object expectedObject;
- private static AccessContextId contextId1;
-
- @BeforeClass
- public static void setup() {
- expectedUser = MockDataFactory.createArtifact(13);
- expectedObject = new Object();
- contextId1 = MockDataFactory.createAccessContextId(GUID.create(), "context1");
- }
-
- @Test
- public void testCmProviderReturnsNull() throws OseeCoreException {
- Collection<Object> objects = new ArrayList<Object>();
- objects.add(expectedObject);
- MockConfigurationManagementProvider cmProvider =
- new MockConfigurationManagementProvider(expectedUser, expectedObject, null);
- IAccessProvider accessProvider = new CmAccessProvider(cmProvider);
-
- AccessData accessData = new AccessData();
- accessProvider.computeAccess(expectedUser, objects, accessData);
- Assert.assertTrue(cmProvider.wasGetCMCalled());
- }
-
- @Test
- public void testCmProvider() throws OseeCoreException {
- MockAccessModel accessModel = new MockAccessModel();
- MockCMWithAccessModel cm =
- new MockCMWithAccessModel(accessModel, expectedUser, expectedObject, false, Collections.singleton(contextId1));
- Collection<Object> objects = new ArrayList<Object>();
- objects.add(expectedObject);
- MockConfigurationManagementProvider cmProvider =
- new MockConfigurationManagementProvider(expectedUser, expectedObject, cm);
- IAccessProvider accessProvider = new CmAccessProvider(cmProvider);
-
- AccessData accessData = new AccessData();
- accessProvider.computeAccess(expectedUser, objects, accessData);
- Assert.assertTrue(cmProvider.wasGetCMCalled());
-
- Assert.assertTrue(accessModel.wasComputeAccessCalled);
- Assert.assertEquals(contextId1, accessModel.contextId);
- Assert.assertTrue(!Compare.isDifferent(objects, accessModel.objectsToCheck));
- Assert.assertEquals(accessData, accessModel.accessData);
- }
-
- private final class MockAccessModel implements AccessModel {
-
- protected boolean wasComputeAccessCalled;
- protected AccessContextId contextId;
- protected Collection<Object> objectsToCheck;
- protected AccessData accessData;
-
- @Override
- public void computeAccess(AccessContextId contextId, Collection<Object> objectsToCheck, AccessData accessData) {
- wasComputeAccessCalled = true;
- this.contextId = contextId;
- this.objectsToCheck = objectsToCheck;
- this.accessData = accessData;
- }
- }
-
-}
diff --git a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CMAccessTestSuite.java b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CMAccessTestSuite.java
deleted file mode 100644
index 817a92ddb6..0000000000
--- a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CMAccessTestSuite.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.cm;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({ //
-CmAccessProviderTest.class, //
-})
-/**
- * @author Roberto E. Escobar
- */
-public class CmAccessTestSuite {
- // Test Suite Class
-}

Back to the top