diff options
author | Ryan D. Brooks | 2016-09-22 20:49:04 +0000 |
---|---|---|
committer | donald.g.dunne | 2016-09-22 20:49:04 +0000 |
commit | f82254cf416c9b8aff002950f7ac3b782472d64a (patch) | |
tree | 8b2c9effea4705038d1c337102327b269ae56e86 /plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org | |
parent | 436a09eb237df720126c93afd3594a3149d56bc9 (diff) | |
download | org.eclipse.osee-f82254cf416c9b8aff002950f7ac3b782472d64a.tar.gz org.eclipse.osee-f82254cf416c9b8aff002950f7ac3b782472d64a.tar.xz org.eclipse.osee-f82254cf416c9b8aff002950f7ac3b782472d64a.zip |
refactor: Remove getGuid from IRelationType
Change-Id: I9b85998cb8db9325e13e3663f43d96f620ca1402
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org')
2 files changed, 14 insertions, 11 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/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 ce879136c34..ba5a98ecf3f 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandlerTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandlerTest.java @@ -63,7 +63,7 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe @Test public void testProcessDataRelationTypeNoMatch() throws OseeCoreException { IRelationType relationType = CoreRelationTypes.Default_Hierarchical__Child; - XRelationType relationTypeRef = MockModel.createXRelationType(relationType.getGuid(), relationType.getName()); + XRelationType relationTypeRef = MockModel.createXRelationType(relationType); RelationTypeRestriction restriction = MockModel.createRelationTypeRestriction(); restriction.setPermission(AccessPermissionEnum.ALLOW); @@ -78,7 +78,7 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe @Test public void testProcessDataRelationTypeMatchSideANoMatch() throws OseeCoreException { IRelationType relationType = CoreRelationTypes.Default_Hierarchical__Child; - XRelationType relationTypeRef = MockModel.createXRelationType(relationType.getGuid(), relationType.getName()); + XRelationType relationTypeRef = MockModel.createXRelationType(relationType); RelationTypeRestriction restriction = MockModel.createRelationTypeRestriction(); restriction.setPermission(AccessPermissionEnum.ALLOW); @@ -102,7 +102,7 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe @Test public void testProcessDataRelationTypeMatchSideAMatch() throws OseeCoreException { IRelationType relationType = CoreRelationTypes.Default_Hierarchical__Child; - XRelationType relationTypeRef = MockModel.createXRelationType(relationType.getGuid(), relationType.getName()); + XRelationType relationTypeRef = MockModel.createXRelationType(relationType); RelationTypeRestriction restriction = MockModel.createRelationTypeRestriction(); restriction.setPermission(AccessPermissionEnum.ALLOW); @@ -130,7 +130,7 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe @Test public void testProcessDataRelationTypeMatchSideBNoMatch() throws OseeCoreException { IRelationType relationType = CoreRelationTypes.Default_Hierarchical__Child; - XRelationType relationTypeRef = MockModel.createXRelationType(relationType.getGuid(), relationType.getName()); + XRelationType relationTypeRef = MockModel.createXRelationType(relationType); RelationTypeRestriction restriction = MockModel.createRelationTypeRestriction(); restriction.setPermission(AccessPermissionEnum.ALLOW); @@ -155,7 +155,7 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe @Test public void testProcessDataRelationTypeMatchSideBMatch() throws OseeCoreException { IRelationType relationType = CoreRelationTypes.Default_Hierarchical__Child; - XRelationType relationTypeRef = MockModel.createXRelationType(relationType.getGuid(), relationType.getName()); + XRelationType relationTypeRef = MockModel.createXRelationType(relationType); RelationTypeRestriction restriction = MockModel.createRelationTypeRestriction(); restriction.setPermission(AccessPermissionEnum.ALLOW); @@ -183,7 +183,7 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe @Test public void testProcessDataRelationTypeMatchBothMatch() throws OseeCoreException { IRelationType relationType = CoreRelationTypes.Default_Hierarchical__Child; - XRelationType relationTypeRef = MockModel.createXRelationType(relationType.getGuid(), relationType.getName()); + XRelationType relationTypeRef = MockModel.createXRelationType(relationType); RelationTypeRestriction restriction = MockModel.createRelationTypeRestriction(); restriction.setPermission(AccessPermissionEnum.ALLOW); @@ -314,7 +314,7 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe private void testProcessRelationWithArtifactHelper(String artifactName, String matcherArtifactName, Scope expectedScope) throws OseeCoreException { IRelationType relationType = CoreRelationTypes.Default_Hierarchical__Child; - XRelationType relationTypeRef = MockModel.createXRelationType(relationType.getGuid(), relationType.getName()); + XRelationType relationTypeRef = MockModel.createXRelationType(relationType); RelationTypeRestriction restriction = MockModel.createRelationTypeRestriction(); restriction.setPermission(AccessPermissionEnum.ALLOW); @@ -358,7 +358,7 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe } private static RelationType getTestRelationType(IRelationType relationType, IArtifactType aArtTypeToken, IArtifactType bArtTypeToken) { - return new RelationType(relationType.getGuid(), relationType.getName(), "sideA_" + aArtTypeToken.getName(), + return new RelationType(relationType.getId(), relationType.getName(), "sideA_" + aArtTypeToken.getName(), "sideB_" + bArtTypeToken.getName(), aArtTypeToken, bArtTypeToken, RelationTypeMultiplicity.MANY_TO_MANY, RelationOrderBaseTypes.LEXICOGRAPHICAL_ASC.getGuid()); } diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/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 1433bf8121d..63fcf72fb88 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockModel.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockModel.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.framework.core.dsl.integration.mocks; +import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.dsl.OseeDslResourceUtil; import org.eclipse.osee.framework.core.dsl.oseeDsl.AccessContext; import org.eclipse.osee.framework.core.dsl.oseeDsl.ArtifactMatchRestriction; @@ -121,12 +122,14 @@ public final class MockModel { return toReturn; } - public static XRelationType createXRelationType(long uuid, String name) throws OseeCoreException { + public static XRelationType createXRelationType(IRelationType type) throws OseeCoreException { + String name = type.getName(); + long id = type.getId(); XRelationType toReturn = OseeDslFactory.eINSTANCE.createXRelationType(); Assert.assertNotNull(toReturn); - toReturn.setUuid(HexUtil.toString(uuid)); + toReturn.setUuid(HexUtil.toString(id)); toReturn.setName(name); - Assert.assertEquals(uuid, HexUtil.toLong(toReturn.getUuid())); + Assert.assertEquals(id, HexUtil.toLong(toReturn.getUuid())); Assert.assertEquals(name, toReturn.getName()); return toReturn; } |