diff options
author | rescobar | 2011-02-21 22:52:09 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2011-02-21 22:52:09 +0000 |
commit | 41a37c8485675cffb8e779dfd3e4cf2928d9d280 (patch) | |
tree | c971d2cba215404d068d33b59d419294b91a0f2d /plugins/org.eclipse.osee.framework.core.dsl.integration.test | |
parent | 7489d99453498e0cd13370bbb405fd497ddf912a (diff) | |
download | org.eclipse.osee-41a37c8485675cffb8e779dfd3e4cf2928d9d280.tar.gz org.eclipse.osee-41a37c8485675cffb8e779dfd3e4cf2928d9d280.tar.xz org.eclipse.osee-41a37c8485675cffb8e779dfd3e4cf2928d9d280.zip |
feature[ats_YGHW1]: Restructure packages in core.dsl.integration.test
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.dsl.integration.test')
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/META-INF/MANIFEST.MF | 2 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/AllDslIntegrationTestSuite.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/AllDslIntegrationTestSuite.java) | 6 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/OseeDslAccessModelTest.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/OseeDslAccessModelTest.java) | 6 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/AccessModelInterpreterImplTest.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/AccessModelInterpreterImplTest.java) | 24 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactTypeRestrictionHandlerTest.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/ArtifactTypeRestrictionHandlerTest.java) | 14 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandlerTest.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/AttributeTypeRestrictionHandlerTest.java) | 40 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/BaseRestrictionHandlerTest.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/BaseRestrictionHandlerTest.java) | 6 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/InternalTestSuite.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/InternalTestSuite.java) | 2 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandlerTest.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/RelationTypeRestrictionHandlerTest.java) | 30 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/CheckAccessDetailCollectorNotCalled.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/CheckAccessDetailCollectorNotCalled.java) | 2 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/DslAsserts.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/DslAsserts.java) | 15 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactDataProvider.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockArtifactDataProvider.java) | 12 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactProxy.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockArtifactData.java) | 48 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockDslProvider.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockDslProvider.java) | 2 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockModel.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockModel.java) | 16 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockRestrictionHandler.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockRestrictionHandler.java) | 14 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/testAccessModel.osee | 60 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/DslUtilTestSuite.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/DslUtilTestSuite.java) | 2 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/ModelUtilTest.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/ModelUtilTest.java) | 0 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/OseeDslSegmentParserTest.java) | 2 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeUtilTest.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/OseeUtilTest.java) | 2 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/testTypeModel.osee (renamed from plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/testTypeModel.osee) | 0 |
22 files changed, 138 insertions, 167 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/META-INF/MANIFEST.MF index 3707e53dc29..cbaa7bc0a45 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/META-INF/MANIFEST.MF @@ -10,4 +10,4 @@ Require-Bundle: org.junit Import-Package: org.eclipse.osee.framework.core.dsl.integration, org.eclipse.osee.framework.core.model.test.mocks, org.eclipse.osee.framework.jdk.core.type -Export-Package: org.eclipse.osee.framework.core.dsl.integration.test +Export-Package: org.eclipse.osee.framework.core.dsl.integration diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/AllDslIntegrationTestSuite.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/AllDslIntegrationTestSuite.java index 80d900ba79d..6b2006d28e5 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/AllDslIntegrationTestSuite.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/AllDslIntegrationTestSuite.java @@ -8,10 +8,10 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test; +package org.eclipse.osee.framework.core.dsl.integration; -import org.eclipse.osee.framework.core.dsl.integration.test.internal.InternalTestSuite; -import org.eclipse.osee.framework.core.dsl.integration.test.util.DslUtilTestSuite; +import org.eclipse.osee.framework.core.dsl.integration.internal.InternalTestSuite; +import org.eclipse.osee.framework.core.dsl.integration.util.DslUtilTestSuite; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/OseeDslAccessModelTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/OseeDslAccessModelTest.java index d6c908cc25a..395d9ac4579 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/OseeDslAccessModelTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/OseeDslAccessModelTest.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test; +package org.eclipse.osee.framework.core.dsl.integration; import java.util.ArrayList; import java.util.Collection; @@ -17,8 +17,8 @@ import org.eclipse.osee.framework.core.data.AccessContextId; import org.eclipse.osee.framework.core.data.TokenFactory; import org.eclipse.osee.framework.core.dsl.integration.AccessModelInterpreter; import org.eclipse.osee.framework.core.dsl.integration.OseeDslAccessModel; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockDslProvider; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockModel; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockDslProvider; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockModel; import org.eclipse.osee.framework.core.dsl.oseeDsl.AccessContext; import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDsl; import org.eclipse.osee.framework.core.enums.PermissionEnum; diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/AccessModelInterpreterImplTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/AccessModelInterpreterImplTest.java index f6df3508bb5..2f2f65b073c 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/AccessModelInterpreterImplTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/AccessModelInterpreterImplTest.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.internal; +package org.eclipse.osee.framework.core.dsl.integration.internal; import java.util.Arrays; import java.util.Collection; @@ -17,11 +17,11 @@ import junit.framework.Assert; import org.eclipse.osee.framework.core.data.AccessContextId; import org.eclipse.osee.framework.core.data.TokenFactory; import org.eclipse.osee.framework.core.dsl.integration.internal.AccessModelInterpreterImpl; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.CheckAccessDetailCollectorNotCalled; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockArtifactData; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockArtifactDataProvider; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockModel; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockRestrictionHandler; +import org.eclipse.osee.framework.core.dsl.integration.mocks.CheckAccessDetailCollectorNotCalled; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockArtifactDataProvider; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockArtifactProxy; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockModel; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockRestrictionHandler; import org.eclipse.osee.framework.core.dsl.oseeDsl.AccessContext; import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction; import org.eclipse.osee.framework.core.exception.OseeArgumentException; @@ -48,7 +48,7 @@ public class AccessModelInterpreterImplTest { @Before public void setup() { - interpreterNoArtData = new AccessModelInterpreterImpl(null); + interpreterNoArtData = new AccessModelInterpreterImpl(null, null); contextId1 = TokenFactory.createAccessContextId(GUID.create(), "Context 1"); contextId2 = TokenFactory.createAccessContextId(GUID.create(), "Context 2"); @@ -97,7 +97,7 @@ public class AccessModelInterpreterImplTest { public void testComputeAccessNotApplicableObject() throws OseeCoreException { final Object objectToCheck = new Object(); MockArtifactDataProvider provider = new MockArtifactDataProvider(false, objectToCheck, null); - AccessModelInterpreterImpl interpreter = new AccessModelInterpreterImpl(provider); + AccessModelInterpreterImpl interpreter = new AccessModelInterpreterImpl(provider, null); interpreter.computeAccessDetails(new CheckAccessDetailCollectorNotCalled(), expectedContext1, objectToCheck); Assert.assertTrue("Provider isApplicableCalled failed", provider.wasIsApplicableCalled()); Assert.assertFalse("Provider asCastedObjectCalled failed", provider.wasAsCastedObjectCalled()); @@ -107,7 +107,7 @@ public class AccessModelInterpreterImplTest { public void testComputeAccessCastedObjectNull() throws OseeCoreException { final Object objectToCheck = new Object(); MockArtifactDataProvider provider = new MockArtifactDataProvider(true, objectToCheck, null); - AccessModelInterpreterImpl interpreter = new AccessModelInterpreterImpl(provider); + AccessModelInterpreterImpl interpreter = new AccessModelInterpreterImpl(provider, null); try { interpreter.computeAccessDetails(new CheckAccessDetailCollectorNotCalled(), expectedContext1, objectToCheck); } finally { @@ -120,19 +120,19 @@ public class AccessModelInterpreterImplTest { public void testComputeAccessCheckRestriction() throws OseeCoreException { AccessContext accessContext = MockModel.createAccessContext(contextId2.getGuid(), "c2"); - MockArtifactData artifactData = new MockArtifactData("1234", null); + MockArtifactProxy artifactData = new MockArtifactProxy("1234", null); ObjectRestriction objectRestriction = null; assertComputeDetails(accessContext, artifactData, objectRestriction, false); } - private static void assertComputeDetails(AccessContext accessContext, MockArtifactData artifactData, ObjectRestriction objectRestriction, boolean expectedProcessCalled) throws OseeCoreException { + private static void assertComputeDetails(AccessContext accessContext, MockArtifactProxy artifactData, ObjectRestriction objectRestriction, boolean expectedProcessCalled) throws OseeCoreException { final Object objectToCheck = new Object(); MockArtifactDataProvider provider = new MockArtifactDataProvider(true, objectToCheck, artifactData); AccessDetailCollector collector = new CheckAccessDetailCollectorNotCalled(); MockRestrictionHandler restrictionHandler = new MockRestrictionHandler(objectRestriction, artifactData, collector); - AccessModelInterpreterImpl interpreter = new AccessModelInterpreterImpl(provider, restrictionHandler); + AccessModelInterpreterImpl interpreter = new AccessModelInterpreterImpl(provider, null, restrictionHandler); interpreter.computeAccessDetails(collector, accessContext, objectToCheck); Assert.assertTrue("Provider isApplicableCalled failed", provider.wasIsApplicableCalled()); Assert.assertTrue("Provider asCastedObjectCalled failed", provider.wasAsCastedObjectCalled()); diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/ArtifactTypeRestrictionHandlerTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactTypeRestrictionHandlerTest.java index 5b5ade2254b..d295dc9421a 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/ArtifactTypeRestrictionHandlerTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactTypeRestrictionHandlerTest.java @@ -8,15 +8,15 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.internal; +package org.eclipse.osee.framework.core.dsl.integration.internal; import java.util.HashSet; import java.util.Set; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.dsl.integration.internal.ArtifactTypeRestrictionHandler; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.DslAsserts; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockArtifactData; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockModel; +import org.eclipse.osee.framework.core.dsl.integration.mocks.DslAsserts; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockArtifactProxy; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockModel; import org.eclipse.osee.framework.core.dsl.oseeDsl.AccessPermissionEnum; import org.eclipse.osee.framework.core.dsl.oseeDsl.ArtifactTypeRestriction; import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactType; @@ -49,7 +49,7 @@ public class ArtifactTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe restriction.setArtifactTypeRef(artifactTypeRef); ArtifactType artifactType2 = new ArtifactType(GUID.create(), "Some Artifact Type", false); - MockArtifactData artData = new MockArtifactData(GUID.create(), artifactType2); + MockArtifactProxy artData = new MockArtifactProxy(GUID.create(), artifactType2); DslAsserts.assertNullAccessDetail(getRestrictionHandler(), restriction, artData); } @@ -63,7 +63,7 @@ public class ArtifactTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe restriction.setArtifactTypeRef(artifactTypeRef); ArtifactType expectedAccessObject = new ArtifactType(artifactType.getGuid(), artifactType.getName(), false); - MockArtifactData artData = new MockArtifactData(GUID.create(), expectedAccessObject); + MockArtifactProxy artData = new MockArtifactProxy(GUID.create(), expectedAccessObject); DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artData, expectedAccessObject, PermissionEnum.WRITE); @@ -81,7 +81,7 @@ public class ArtifactTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe ArtifactType expectedAccessObject = new ArtifactType(CoreArtifactTypes.Requirement.getGuid(), CoreArtifactTypes.Requirement.getName(), false); - MockArtifactData artData = new MockArtifactData(GUID.create(), expectedAccessObject); + MockArtifactProxy artData = new MockArtifactProxy(GUID.create(), expectedAccessObject); DslAsserts.assertNullAccessDetail(getRestrictionHandler(), restriction, artData); // Make expectedAccessObject inherit from ArtifactType diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/AttributeTypeRestrictionHandlerTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandlerTest.java index 82718d1571d..7c82e6e4435 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/AttributeTypeRestrictionHandlerTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandlerTest.java @@ -8,18 +8,18 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.internal; +package org.eclipse.osee.framework.core.dsl.integration.internal; import java.util.HashSet; import java.util.Set; import junit.framework.Assert; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactData; +import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactProxy; import org.eclipse.osee.framework.core.dsl.integration.internal.AttributeTypeRestrictionHandler; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.DslAsserts; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockArtifactData; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockModel; +import org.eclipse.osee.framework.core.dsl.integration.mocks.DslAsserts; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockArtifactProxy; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockModel; import org.eclipse.osee.framework.core.dsl.oseeDsl.AccessPermissionEnum; import org.eclipse.osee.framework.core.dsl.oseeDsl.AttributeTypeRestriction; import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactType; @@ -57,8 +57,8 @@ public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerT restriction.setAttributeTypeRef(attributeTypeRef); final MutableBoolean wasIsAttributeTypeValidCalled = new MutableBoolean(false); - ArtifactData artData = createArtifactData(null, attributeType, wasIsAttributeTypeValidCalled, false); - DslAsserts.assertNullAccessDetail(getRestrictionHandler(), restriction, artData); + ArtifactProxy artifactProxy = createArtifactProxy(null, attributeType, wasIsAttributeTypeValidCalled, false); + DslAsserts.assertNullAccessDetail(getRestrictionHandler(), restriction, artifactProxy); Assert.assertTrue(wasIsAttributeTypeValidCalled.getValue()); } @@ -74,8 +74,9 @@ public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerT restriction.setAttributeTypeRef(attributeTypeRef); final MutableBoolean wasIsAttributeTypeValidCalled = new MutableBoolean(false); - ArtifactData artData = createArtifactData(null, attributeType, wasIsAttributeTypeValidCalled, true); - DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artData, attributeType, PermissionEnum.WRITE); + ArtifactProxy artifactProxy = createArtifactProxy(null, attributeType, wasIsAttributeTypeValidCalled, true); + DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artifactProxy, attributeType, + PermissionEnum.WRITE); Assert.assertTrue(wasIsAttributeTypeValidCalled.getValue()); } @@ -98,8 +99,9 @@ public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerT ArtifactType artArtifactType = new ArtifactType(artifactType2.getGuid(), artifactType2.getName(), false); final MutableBoolean wasIsAttributeTypeValidCalled = new MutableBoolean(false); - ArtifactData artData = createArtifactData(artArtifactType, attributeType, wasIsAttributeTypeValidCalled, true); - DslAsserts.assertNullAccessDetail(getRestrictionHandler(), restriction, artData); + ArtifactProxy artifactProxy = + createArtifactProxy(artArtifactType, attributeType, wasIsAttributeTypeValidCalled, true); + DslAsserts.assertNullAccessDetail(getRestrictionHandler(), restriction, artifactProxy); Assert.assertTrue(wasIsAttributeTypeValidCalled.getValue()); } @@ -121,8 +123,10 @@ public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerT ArtifactType artArtifactType = new ArtifactType(artifactType.getGuid(), artifactType.getName(), false); final MutableBoolean wasIsAttributeTypeValidCalled = new MutableBoolean(false); - ArtifactData artData = createArtifactData(artArtifactType, attributeType, wasIsAttributeTypeValidCalled, true); - DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artData, attributeType, PermissionEnum.WRITE); + ArtifactProxy artifactProxy = + createArtifactProxy(artArtifactType, attributeType, wasIsAttributeTypeValidCalled, true); + DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artifactProxy, attributeType, + PermissionEnum.WRITE); Assert.assertTrue(wasIsAttributeTypeValidCalled.getValue()); } @@ -150,13 +154,15 @@ public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerT artArtifactType.setSuperTypes(superTypes); final MutableBoolean wasIsAttributeTypeValidCalled = new MutableBoolean(false); - ArtifactData artData = createArtifactData(artArtifactType, attributeType, wasIsAttributeTypeValidCalled, true); - DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artData, attributeType, PermissionEnum.WRITE); + ArtifactProxy artifactProxy = + createArtifactProxy(artArtifactType, attributeType, wasIsAttributeTypeValidCalled, true); + DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artifactProxy, attributeType, + PermissionEnum.WRITE); Assert.assertTrue(wasIsAttributeTypeValidCalled.getValue()); } - private static ArtifactData createArtifactData(ArtifactType artifactType, final IAttributeType expectedAttributeType, final MutableBoolean wasIsAttributeTypeValidCalled, final boolean isTypeValid) { - MockArtifactData artData = new MockArtifactData(GUID.create(), artifactType) { + private static ArtifactProxy createArtifactProxy(ArtifactType artifactType, final IAttributeType expectedAttributeType, final MutableBoolean wasIsAttributeTypeValidCalled, final boolean isTypeValid) { + MockArtifactProxy artData = new MockArtifactProxy(GUID.create(), artifactType) { @Override public boolean isAttributeTypeValid(IAttributeType attributeType) { diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/BaseRestrictionHandlerTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/BaseRestrictionHandlerTest.java index 3355a8d98dd..085d09f9d2a 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/BaseRestrictionHandlerTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/BaseRestrictionHandlerTest.java @@ -8,12 +8,12 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.internal; +package org.eclipse.osee.framework.core.dsl.integration.internal; import junit.framework.Assert; import org.eclipse.osee.framework.core.dsl.integration.RestrictionHandler; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.DslAsserts; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockModel; +import org.eclipse.osee.framework.core.dsl.integration.mocks.DslAsserts; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockModel; import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.junit.Test; diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/InternalTestSuite.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/InternalTestSuite.java index 081ac03598a..4e8cd5fd3ee 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/InternalTestSuite.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/InternalTestSuite.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.internal; +package org.eclipse.osee.framework.core.dsl.integration.internal; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/RelationTypeRestrictionHandlerTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandlerTest.java index 34736a3bf7d..61fb25086a5 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/internal/RelationTypeRestrictionHandlerTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandlerTest.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.internal; +package org.eclipse.osee.framework.core.dsl.integration.internal; import java.util.ArrayList; import java.util.Collections; @@ -19,9 +19,9 @@ import junit.framework.Assert; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.dsl.integration.internal.RelationTypeRestrictionHandler; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.DslAsserts; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockArtifactData; -import org.eclipse.osee.framework.core.dsl.integration.test.mocks.MockModel; +import org.eclipse.osee.framework.core.dsl.integration.mocks.DslAsserts; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockArtifactProxy; +import org.eclipse.osee.framework.core.dsl.integration.mocks.MockModel; import org.eclipse.osee.framework.core.dsl.oseeDsl.AccessPermissionEnum; import org.eclipse.osee.framework.core.dsl.oseeDsl.RelationTypeRestriction; import org.eclipse.osee.framework.core.dsl.oseeDsl.XRelationSideEnum; @@ -63,7 +63,7 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe restriction.setRelationTypeRef(relationTypeRef); // Artifact Data has no relation types therefore relation type will not match - MockArtifactData artData = new MockArtifactData(GUID.create(), null); + MockArtifactProxy artData = new MockArtifactProxy(GUID.create(), null); DslAsserts.assertNullAccessDetail(getRestrictionHandler(), restriction, artData); } @@ -83,8 +83,8 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe IArtifactType artTypeToken1 = CoreArtifactTypes.SoftwareRequirement; ArtifactType artArtType = new ArtifactType(artTypeToken1.getGuid(), artTypeToken1.getName(), false); - MockArtifactData artData = - new MockArtifactData(GUID.create(), artArtType, null, null, Collections.singleton(testRelationType)); + MockArtifactProxy artData = + new MockArtifactProxy(GUID.create(), artArtType, null, null, Collections.singleton(testRelationType)); DslAsserts.assertNullAccessDetail(getRestrictionHandler(), restriction, artData); } @@ -107,8 +107,8 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe superTypes.add(new ArtifactType(CoreArtifactTypes.Artifact.getGuid(), CoreArtifactTypes.Artifact.getName(), false)); artArtType.setSuperTypes(superTypes); - MockArtifactData artData = - new MockArtifactData(GUID.create(), artArtType, null, null, Collections.singleton(testRelationType)); + MockArtifactProxy artData = + new MockArtifactProxy(GUID.create(), artArtType, null, null, Collections.singleton(testRelationType)); RelationTypeSide expectedObject = new RelationTypeSide(testRelationType, RelationSide.SIDE_A); DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artData, expectedObject, PermissionEnum.WRITE); } @@ -129,8 +129,8 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe IArtifactType artTypeToken1 = CoreArtifactTypes.SoftwareRequirement; ArtifactType artArtType = new ArtifactType(artTypeToken1.getGuid(), artTypeToken1.getName(), false); - MockArtifactData artData = - new MockArtifactData(GUID.create(), artArtType, null, null, Collections.singleton(testRelationType)); + MockArtifactProxy artData = + new MockArtifactProxy(GUID.create(), artArtType, null, null, Collections.singleton(testRelationType)); DslAsserts.assertNullAccessDetail(getRestrictionHandler(), restriction, artData); } @@ -153,8 +153,8 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe superTypes.add(new ArtifactType(CoreArtifactTypes.Artifact.getGuid(), CoreArtifactTypes.Artifact.getName(), false)); artArtType.setSuperTypes(superTypes); - MockArtifactData artData = - new MockArtifactData(GUID.create(), artArtType, null, null, Collections.singleton(testRelationType)); + MockArtifactProxy artData = + new MockArtifactProxy(GUID.create(), artArtType, null, null, Collections.singleton(testRelationType)); RelationTypeSide expectedObject = new RelationTypeSide(testRelationType, RelationSide.SIDE_B); DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artData, expectedObject, PermissionEnum.WRITE); } @@ -178,8 +178,8 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe superTypes.add(new ArtifactType(CoreArtifactTypes.Artifact.getGuid(), CoreArtifactTypes.Artifact.getName(), false)); artArtType.setSuperTypes(superTypes); - MockArtifactData artData = - new MockArtifactData(GUID.create(), artArtType, null, null, Collections.singleton(testRelationType)); + MockArtifactProxy artData = + new MockArtifactProxy(GUID.create(), artArtType, null, null, Collections.singleton(testRelationType)); RelationTypeSide expectedObject1 = new RelationTypeSide(testRelationType, RelationSide.SIDE_A); RelationTypeSide expectedObject2 = new RelationTypeSide(testRelationType, RelationSide.SIDE_B); diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/CheckAccessDetailCollectorNotCalled.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/CheckAccessDetailCollectorNotCalled.java index a5a834b4daf..4aeef27b2df 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/CheckAccessDetailCollectorNotCalled.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/CheckAccessDetailCollectorNotCalled.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.mocks; +package org.eclipse.osee.framework.core.dsl.integration.mocks; import org.eclipse.osee.framework.core.model.access.AccessDetail; import org.eclipse.osee.framework.core.model.access.AccessDetailCollector; diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/DslAsserts.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/DslAsserts.java index dfd682c1829..6d4c453d5d1 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/DslAsserts.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/DslAsserts.java @@ -8,10 +8,10 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.mocks; +package org.eclipse.osee.framework.core.dsl.integration.mocks; import junit.framework.Assert; -import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactData; +import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactProxy; import org.eclipse.osee.framework.core.dsl.integration.RestrictionHandler; import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction; import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDsl; @@ -29,13 +29,13 @@ public final class DslAsserts { // Utility class } - public static void assertNullAccessDetail(RestrictionHandler<?> handler, ObjectRestriction restriction, ArtifactData artifactData) throws OseeCoreException { - assertAccessDetail(handler, restriction, artifactData, null, null); + public static void assertNullAccessDetail(RestrictionHandler<?> handler, ObjectRestriction restriction, ArtifactProxy artifactProxy) throws OseeCoreException { + assertAccessDetail(handler, restriction, artifactProxy, null, null); } - public static void assertAccessDetail(RestrictionHandler<?> handler, ObjectRestriction restriction, ArtifactData artifactData, Object expectedAccessObject, PermissionEnum expectedPermission) throws OseeCoreException { + public static void assertAccessDetail(RestrictionHandler<?> handler, ObjectRestriction restriction, ArtifactProxy artifactProxy, Object expectedAccessObject, PermissionEnum expectedPermission) throws OseeCoreException { MockAccessDetailCollector collector = new MockAccessDetailCollector(); - handler.process(restriction, artifactData, collector); + handler.process(restriction, artifactProxy, collector); AccessDetail<?> actualDetail = collector.getAccessDetails(); if (expectedAccessObject == null) { Assert.assertNull(actualDetail); @@ -48,10 +48,9 @@ public final class DslAsserts { public static void assertEquals(OseeDsl model1, OseeDsl model2) { Assert.assertEquals(model1.getAccessDeclarations().size(), model2.getAccessDeclarations().size()); - Assert.assertEquals(model1.getArtifactRefs().size(), model2.getArtifactRefs().size()); + Assert.assertEquals(model1.getArtifactMatchRefs().size(), model2.getArtifactMatchRefs().size()); Assert.assertEquals(model1.getArtifactTypes().size(), model2.getArtifactTypes().size()); Assert.assertEquals(model1.getAttributeTypes().size(), model2.getAttributeTypes().size()); - Assert.assertEquals(model1.getBranchRefs().size(), model2.getBranchRefs().size()); Assert.assertEquals(model1.getEnumOverrides().size(), model2.getEnumOverrides().size()); Assert.assertEquals(model1.getEnumTypes().size(), model2.getEnumTypes().size()); Assert.assertEquals(model1.getImports().size(), model2.getImports().size()); diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockArtifactDataProvider.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactDataProvider.java index e57bb964fb3..9bc1cf7f690 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockArtifactDataProvider.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactDataProvider.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.mocks; +package org.eclipse.osee.framework.core.dsl.integration.mocks; import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider; import org.junit.Assert; @@ -20,14 +20,14 @@ public final class MockArtifactDataProvider implements ArtifactDataProvider { private final boolean isApplicable; private final Object expectedObject; - private final ArtifactData artifactData; + private final ArtifactProxy artifactProxy; private boolean wasIsApplicableCalled; private boolean wasAsCastedObjectCalled; - public MockArtifactDataProvider(boolean isApplicable, Object expectedObject, ArtifactData artifactData) { + public MockArtifactDataProvider(boolean isApplicable, Object expectedObject, ArtifactProxy artifactProxy) { this.isApplicable = isApplicable; this.expectedObject = expectedObject; - this.artifactData = artifactData; + this.artifactProxy = artifactProxy; reset(); } @@ -44,10 +44,10 @@ public final class MockArtifactDataProvider implements ArtifactDataProvider { } @Override - public ArtifactData asCastedObject(Object object) { + public ArtifactProxy asCastedObject(Object object) { wasAsCastedObjectCalled = true; Assert.assertEquals(expectedObject, object); - return artifactData; + return artifactProxy; } public boolean wasIsApplicableCalled() { diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockArtifactData.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactProxy.java index 499cdca275c..91cedb72ac0 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockArtifactData.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactProxy.java @@ -8,12 +8,15 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.mocks; +package org.eclipse.osee.framework.core.dsl.integration.mocks; import java.util.Collection; import java.util.Collections; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactData; +import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.Identity; +import org.eclipse.osee.framework.core.data.Named; +import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactProxy; import org.eclipse.osee.framework.core.model.IBasicArtifact; import org.eclipse.osee.framework.core.model.type.ArtifactType; import org.eclipse.osee.framework.core.model.type.RelationType; @@ -21,24 +24,24 @@ import org.eclipse.osee.framework.core.model.type.RelationType; /** * @author Roberto E. Escobar */ -public class MockArtifactData implements ArtifactData { +public class MockArtifactProxy implements ArtifactProxy { private final String guid; private final ArtifactType artifactType; - private final Collection<String> hierarchy; + private final Collection<ArtifactProxy> hierarchy; private final Collection<RelationType> validRelationTypes; private final IBasicArtifact<?> artifactObject; - public MockArtifactData(IBasicArtifact<?> artifactObject) { + public MockArtifactProxy(IBasicArtifact<?> artifactObject) { this(artifactObject.getGuid(), artifactObject.getArtifactType(), artifactObject, - Collections.<String> emptyList(), Collections.<RelationType> emptyList()); + Collections.<ArtifactProxy> emptyList(), Collections.<RelationType> emptyList()); } - public MockArtifactData(String guid, ArtifactType artifactType) { - this(guid, artifactType, null, Collections.<String> emptyList(), Collections.<RelationType> emptyList()); + public MockArtifactProxy(String guid, ArtifactType artifactType) { + this(guid, artifactType, null, Collections.<ArtifactProxy> emptyList(), Collections.<RelationType> emptyList()); } - public MockArtifactData(String guid, ArtifactType artifactType, IBasicArtifact<?> artifactObject, Collection<String> hierarchy, Collection<RelationType> validRelationTypes) { + public MockArtifactProxy(String guid, ArtifactType artifactType, IBasicArtifact<?> artifactObject, Collection<ArtifactProxy> hierarchy, Collection<RelationType> validRelationTypes) { this.guid = guid; this.artifactType = artifactType; this.hierarchy = hierarchy; @@ -67,7 +70,7 @@ public class MockArtifactData implements ArtifactData { } @Override - public Collection<String> getHierarchy() { + public Collection<ArtifactProxy> getHierarchy() { return hierarchy; } @@ -75,4 +78,29 @@ public class MockArtifactData implements ArtifactData { public IBasicArtifact<?> getObject() { return artifactObject; } + + @Override + public IOseeBranch getBranch() { + return artifactObject.getBranch(); + } + + @Override + public String getName() { + return artifactObject.getName(); + } + + @Override + public boolean matches(Identity... identities) { + return artifactObject.matches(identities); + } + + @Override + public String getUnqualifiedName() { + return artifactObject.getUnqualifiedName(); + } + + @Override + public int compareTo(Named o) { + return artifactObject.compareTo(o); + } } diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockDslProvider.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockDslProvider.java index 7bfaecfe94a..ed9ce5aa9f7 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockDslProvider.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockDslProvider.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.mocks; +package org.eclipse.osee.framework.core.dsl.integration.mocks; import org.eclipse.osee.framework.core.dsl.integration.OseeDslProvider; import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDsl; diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockModel.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockModel.java index 8276d1da9b5..eaaae27655b 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockModel.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockModel.java @@ -8,18 +8,18 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.mocks; +package org.eclipse.osee.framework.core.dsl.integration.mocks; import junit.framework.Assert; import org.eclipse.osee.framework.core.dsl.oseeDsl.AccessContext; -import org.eclipse.osee.framework.core.dsl.oseeDsl.ArtifactInstanceRestriction; +import org.eclipse.osee.framework.core.dsl.oseeDsl.ArtifactMatchRestriction; import org.eclipse.osee.framework.core.dsl.oseeDsl.ArtifactTypeRestriction; import org.eclipse.osee.framework.core.dsl.oseeDsl.AttributeTypeRestriction; import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction; import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDsl; import org.eclipse.osee.framework.core.dsl.oseeDsl.OseeDslFactory; import org.eclipse.osee.framework.core.dsl.oseeDsl.RelationTypeRestriction; -import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactRef; +import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactMatcher; import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactType; import org.eclipse.osee.framework.core.dsl.oseeDsl.XAttributeType; import org.eclipse.osee.framework.core.dsl.oseeDsl.XRelationType; @@ -55,8 +55,8 @@ public final class MockModel { return toReturn; } - public static ArtifactInstanceRestriction createArtifactInstanceRestriction() { - ArtifactInstanceRestriction toReturn = OseeDslFactory.eINSTANCE.createArtifactInstanceRestriction(); + public static ArtifactMatchRestriction createArtifactMatchRestriction() { + ArtifactMatchRestriction toReturn = OseeDslFactory.eINSTANCE.createArtifactMatchRestriction(); Assert.assertNotNull(toReturn); return toReturn; } @@ -79,12 +79,10 @@ public final class MockModel { return toReturn; } - public static XArtifactRef createXArtifactRef(String guid, String name) { - XArtifactRef toReturn = OseeDslFactory.eINSTANCE.createXArtifactRef(); + public static XArtifactMatcher createXArtifactMatcherRef(String name) { + XArtifactMatcher toReturn = OseeDslFactory.eINSTANCE.createXArtifactMatcher(); Assert.assertNotNull(toReturn); - toReturn.setGuid(guid); toReturn.setName(name); - Assert.assertEquals(guid, toReturn.getGuid()); Assert.assertEquals(name, toReturn.getName()); return toReturn; } diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockRestrictionHandler.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockRestrictionHandler.java index 91c2e89e8dd..e970d9b788a 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/mocks/MockRestrictionHandler.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockRestrictionHandler.java @@ -8,9 +8,9 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.mocks; +package org.eclipse.osee.framework.core.dsl.integration.mocks; -import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactData; +import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactProxy; import org.eclipse.osee.framework.core.dsl.integration.RestrictionHandler; import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction; import org.eclipse.osee.framework.core.model.access.AccessDetailCollector; @@ -22,14 +22,14 @@ import org.junit.Assert; public class MockRestrictionHandler implements RestrictionHandler<Object> { private final ObjectRestriction expectedObjectRestriction; - private final ArtifactData expectedArtifactData; + private final ArtifactProxy expectedArtifactProxy; private final AccessDetailCollector expectedCollector; private boolean wasProcessCalled; - public MockRestrictionHandler(ObjectRestriction expectedObjectRestriction, ArtifactData expectedArtifactData, AccessDetailCollector expectedCollector) { + public MockRestrictionHandler(ObjectRestriction expectedObjectRestriction, ArtifactProxy expectedArtifactProxy, AccessDetailCollector expectedCollector) { super(); this.expectedObjectRestriction = expectedObjectRestriction; - this.expectedArtifactData = expectedArtifactData; + this.expectedArtifactProxy = expectedArtifactProxy; this.expectedCollector = expectedCollector; reset(); } @@ -48,10 +48,10 @@ public class MockRestrictionHandler implements RestrictionHandler<Object> { } @Override - public void process(ObjectRestriction objectRestriction, ArtifactData artifactData, AccessDetailCollector collector) { + public void process(ObjectRestriction objectRestriction, ArtifactProxy artifactProxy, AccessDetailCollector collector) { wasProcessCalled = true; Assert.assertEquals(expectedObjectRestriction, objectRestriction); - Assert.assertEquals(expectedArtifactData, artifactData); + Assert.assertEquals(expectedArtifactProxy, artifactProxy); Assert.assertEquals(expectedCollector, collector); } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/testAccessModel.osee b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/testAccessModel.osee deleted file mode 100644 index f859e264424..00000000000 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/testAccessModel.osee +++ /dev/null @@ -1,60 +0,0 @@ -//import "platform:/org.eclipse.osee.framework.core.dsl.integration.test/testTypeModel.osee" -artifactType "Artifact" { - guid "BZOUrxO35x+LBZkEYzAA" -} - -artifactType "Software Requirement" extends "Artifact" { - guid "BZO4PuM+Oz58hpAcTGwA" -} - -attributeType "Qualification Method" extends StringAttribute { - guid "BZPB25t9fRVnLuII6+wA" - dataProvider DefaultAttributeDataProvider - min 0 - max 1 - defaultValue "test" -} - -artifact "Software Items" artGuid "AAMFEcWy0xc4e3tcem99"; -artifact "Systems" artGuid "AAMFEcWy0xc4e3tcem88"; -artifact "SubSystems" artGuid "AAMFEcWy0xc4e3tcem77"; - -// Access Contexts - -accessContext "System Context" { - guid "AAMFEcWy0xc4e3tcem11"; - DENY edit artifactType "Artifact"; - childrenOf "Software Items" { - DENY edit artifactType "Artifact"; - } - - childrenOf "Systems" { - DENY edit artifactType "Artifact"; - } - - childrenOf "SubSystems" { - DENY edit artifactType "Artifact"; - } - -} - -accessContext "subsystem.requirement.writer" extends "System Context" { - guid "AAMFEcWy0xc4e3tcem22"; - DENY edit attributeType "Qualification Method" of artifactType "Software Requirement"; - - // ALLOW edit attributeType "Annotation" of artifactType "Software Requirement"; - ALLOW edit attributeType "Qualification Method" of artifactType "Software Requirement"; - ALLOW edit attributeType "Qualification Method" of artifactType "Software Requirement"; - - // childrenOf "SubSystem Requirement" { - // ALLOW edit artifactType "Artifact"; - // } - //} - // - //accessContext "software.requirement.writer" extends "System Context" { - // guid "AAMFEcWy0xc4e3tcem33"; - // childrenOf "SubSystem Requirement" { - // ALLOW edit artifactType "Artifact"; - // } - -} diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/DslUtilTestSuite.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/DslUtilTestSuite.java index 88e99687516..62603dc5d4b 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/DslUtilTestSuite.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/DslUtilTestSuite.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.util; +package org.eclipse.osee.framework.core.dsl.integration.util; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/ModelUtilTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/ModelUtilTest.java index 6ca819d4683..6ca819d4683 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/ModelUtilTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/ModelUtilTest.java diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/OseeDslSegmentParserTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java index 8fe7e207a77..866959c8840 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/OseeDslSegmentParserTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.util; +package org.eclipse.osee.framework.core.dsl.integration.util; import java.util.Arrays; import java.util.Collection; diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/OseeUtilTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeUtilTest.java index 9f2998f0733..14a22362c35 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/OseeUtilTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeUtilTest.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.core.dsl.integration.test.util; +package org.eclipse.osee.framework.core.dsl.integration.util; import java.util.HashMap; import java.util.Map; diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/testTypeModel.osee b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/testTypeModel.osee index 3d989ddd5be..3d989ddd5be 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/test/util/testTypeModel.osee +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/testTypeModel.osee |