diff options
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org')
6 files changed, 50 insertions, 65 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeUtilTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeUtilTest.java index d742daf0a7e..1a076af4046 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeUtilTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeUtilTest.java @@ -29,7 +29,6 @@ import org.eclipse.osee.framework.core.enums.RelationSide; import org.eclipse.osee.framework.jdk.core.type.Id; import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; -import org.eclipse.osee.framework.jdk.core.util.HexUtil; import org.junit.Assert; import org.junit.Test; @@ -84,7 +83,7 @@ public class OseeUtilTest { Object actual = OseeUtil.toToken(type); Assert.assertEquals(expected, actual); - type.setUuid("0x1111111111111111"); + type.setId("1111111111111111"); actual = OseeUtil.toToken(type); Assert.assertFalse(expected.equals(actual)); } @@ -99,7 +98,7 @@ public class OseeUtilTest { Object actual = OseeUtil.toToken(type); Assert.assertEquals(expected, actual); - type.setUuid("0x1111111111111111"); + type.setId("1111111111111111"); actual = OseeUtil.toToken(type); Assert.assertFalse(expected.equals(actual)); } @@ -114,7 +113,7 @@ public class OseeUtilTest { Object actual = OseeUtil.toToken(type); Assert.assertEquals(expected, actual); - type.setUuid("0x1111111111111111"); + type.setId("1111111111111111"); actual = OseeUtil.toToken(type); Assert.assertFalse(expected.equals(actual)); } @@ -122,12 +121,12 @@ public class OseeUtilTest { private static void setupToToken(OseeType typeToCheck, Id expected) throws OseeCoreException { String name = "bogus name"; // This should not affect equality typeToCheck.setName(name); - String uuid = HexUtil.toString(expected.getId()); - typeToCheck.setUuid(uuid); + String uuid = String.valueOf(expected.getId()); + typeToCheck.setId(uuid); Assert.assertEquals(name, typeToCheck.getName()); - Assert.assertEquals(expected.getId().longValue(), HexUtil.toLong(typeToCheck.getUuid())); - Assert.assertEquals(uuid, typeToCheck.getUuid()); + Assert.assertEquals(expected.getId().longValue(), Long.valueOf(typeToCheck.getId()).longValue()); + Assert.assertEquals(uuid, typeToCheck.getId()); } private static void checkIsRestricted(XRelationSideEnum side, boolean expectedSideA, boolean expectedSideB) throws OseeCoreException { diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/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 481be726a8f..a1ac6727b0d 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/DslAsserts.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/DslAsserts.java @@ -88,7 +88,7 @@ public final class DslAsserts { public static void assertEquals(XArtifactType artifactType, String expName, String expGuid, String[] inheritsFrom, String... attributeNames) { Assert.assertEquals(expName, artifactType.getName()); - Assert.assertEquals(expGuid, artifactType.getUuid()); + Assert.assertEquals(expGuid, artifactType.getId()); int index = 0; Assert.assertEquals(inheritsFrom.length, artifactType.getSuperArtifactTypes().size()); @@ -105,7 +105,7 @@ public final class DslAsserts { public static void assertEquals(XAttributeType type, String expName, String expGuid, String baseType, String dataProvider, String min, String max, String tagger, String description, String defaultValue, String ext) { Assert.assertEquals(expName, type.getName()); - Assert.assertEquals(expGuid, type.getUuid()); + Assert.assertEquals(expGuid, type.getId()); Assert.assertEquals(baseType, type.getBaseAttributeType()); Assert.assertEquals(dataProvider, type.getDataProvider()); @@ -119,17 +119,17 @@ public final class DslAsserts { public static void assertEquals(XRelationType type, String expName, String expGuid, String sideA, String aName, String aGuid, String sideB, String bName, String bGuid, String orderType, RelationMultiplicityEnum mult) { Assert.assertEquals(expName, type.getName()); - Assert.assertEquals(expGuid, type.getUuid()); + Assert.assertEquals(expGuid, type.getId()); XArtifactType aArt = type.getSideAArtifactType(); Assert.assertEquals(sideA, type.getSideAName()); Assert.assertEquals(aName, aArt.getName()); - Assert.assertEquals(aGuid, aArt.getUuid()); + Assert.assertEquals(aGuid, aArt.getId()); XArtifactType bArt = type.getSideBArtifactType(); Assert.assertEquals(sideB, type.getSideBName()); Assert.assertEquals(bName, bArt.getName()); - Assert.assertEquals(bGuid, bArt.getUuid()); + Assert.assertEquals(bGuid, bArt.getId()); Assert.assertEquals(orderType, type.getDefaultOrderType()); Assert.assertEquals(mult, type.getMultiplicity()); 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 b503eee0bf2..d5a1d446c4b 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 @@ -25,7 +25,6 @@ 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; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; -import org.eclipse.osee.framework.jdk.core.util.HexUtil; import org.junit.Assert; /** @@ -105,9 +104,9 @@ public final class MockModel { public static XArtifactType createXArtifactType(long uuid, String name) throws OseeCoreException { XArtifactType toReturn = OseeDslFactory.eINSTANCE.createXArtifactType(); Assert.assertNotNull(toReturn); - toReturn.setUuid(HexUtil.toString(uuid)); + toReturn.setId(String.valueOf(uuid)); toReturn.setName(name); - Assert.assertEquals(uuid, HexUtil.toLong(toReturn.getUuid())); + Assert.assertEquals(uuid, Long.valueOf(toReturn.getId()).longValue()); Assert.assertEquals(name, toReturn.getName()); return toReturn; } @@ -115,9 +114,9 @@ public final class MockModel { public static XAttributeType createXAttributeType(long uuid, String name) throws OseeCoreException { XAttributeType toReturn = OseeDslFactory.eINSTANCE.createXAttributeType(); Assert.assertNotNull(toReturn); - toReturn.setUuid(HexUtil.toString(uuid)); + toReturn.setId(String.valueOf(uuid)); toReturn.setName(name); - Assert.assertEquals(uuid, HexUtil.toLong(toReturn.getUuid())); + Assert.assertEquals(uuid, Long.valueOf(toReturn.getId()).longValue()); Assert.assertEquals(name, toReturn.getName()); return toReturn; } @@ -127,9 +126,9 @@ public final class MockModel { long id = type.getId(); XRelationType toReturn = OseeDslFactory.eINSTANCE.createXRelationType(); Assert.assertNotNull(toReturn); - toReturn.setUuid(HexUtil.toString(id)); + toReturn.setId(String.valueOf(id)); toReturn.setName(name); - Assert.assertEquals(id, HexUtil.toLong(toReturn.getUuid())); + Assert.assertEquals(id, Long.valueOf(toReturn.getId()).longValue()); 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/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 369670917fc..f0c97a868fc 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/ModelUtilTest.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/ModelUtilTest.java @@ -37,7 +37,7 @@ import org.junit.Test; /** * Test Case for {@link ModelUtil} - * + * * @author Roberto E. Escobar */ public class ModelUtilTest { @@ -54,30 +54,30 @@ public class ModelUtilTest { Assert.assertEquals(5, model1.getArtifactTypes().size()); Iterator<XArtifactType> type1 = model1.getArtifactTypes().iterator(); // @formatter:off - DslAsserts.assertEquals(type1.next(), "Artifact", "0x0000000000000001", new String[0], "Name", "Annotation"); - DslAsserts.assertEquals(type1.next(), "Requirement", "0x0000000000000015", new String[] {"Artifact"}, "WordML"); - DslAsserts.assertEquals(type1.next(), "Software Requirement", "0x0000000000000018", new String[] {"Requirement"}); - DslAsserts.assertEquals(type1.next(), "System Requirement", "0x000000000000001E", new String[] {"Requirement"}); - DslAsserts.assertEquals(type1.next(), "SubSystem Requirement", "0x000000000000001D", new String[] {"Requirement"}); + DslAsserts.assertEquals(type1.next(), "Artifact", "1", new String[0], "Name", "Annotation"); + DslAsserts.assertEquals(type1.next(), "Requirement", "21", new String[] {"Artifact"}, "WordML"); + DslAsserts.assertEquals(type1.next(), "Software Requirement", "24", new String[] {"Requirement"}); + DslAsserts.assertEquals(type1.next(), "System Requirement", "30", new String[] {"Requirement"}); + DslAsserts.assertEquals(type1.next(), "SubSystem Requirement", "29", new String[] {"Requirement"}); // @formatter:on Assert.assertEquals(3, model1.getAttributeTypes().size()); Iterator<XAttributeType> type2 = model1.getAttributeTypes().iterator(); - DslAsserts.assertEquals(type2.next(), "Name", "0x1000000000000070", "StringAttribute", + DslAsserts.assertEquals(type2.next(), "Name", "1152921504606847088", "StringAttribute", "DefaultAttributeDataProvider", "1", "1", "DefaultAttributeTaggerProvider", // "Descriptive Name", "unnamed", null); - DslAsserts.assertEquals(type2.next(), "Annotation", "0x1000000000000076", "CompressedContentAttribute", + DslAsserts.assertEquals(type2.next(), "Annotation", "1152921504606847094", "CompressedContentAttribute", "UriAttributeDataProvider", "0", "unlimited", "DefaultAttributeTaggerProvider", // "the version \'1.0\' is this \"1.2.0\"", null, null); - DslAsserts.assertEquals(type2.next(), "WordML", "0x100000000000007A", "WordAttribute", "UriAttributeDataProvider", - "0", "1", "XmlAttributeTaggerProvider", "value must comply with WordML xml schema", + DslAsserts.assertEquals(type2.next(), "WordML", "1152921504606847098", "WordAttribute", + "UriAttributeDataProvider", "0", "1", "XmlAttributeTaggerProvider", "value must comply with WordML xml schema", "<w:p xmlns:w=\"http://schemas.microsoft.com/office/word/2003/wordml\"><w:r><w:t></w:t></w:r></w:p>", "xml"); Assert.assertEquals(1, model1.getRelationTypes().size()); Iterator<XRelationType> type3 = model1.getRelationTypes().iterator(); - DslAsserts.assertEquals(type3.next(), "Requirement Relation", "0x2000000000000157", "requirement-sideA", - "Requirement", "0x0000000000000015", "subsystem-sideB", "SubSystem Requirement", "0x000000000000001D", - "Lexicographical_Ascending", RelationMultiplicityEnum.ONE_TO_MANY); + DslAsserts.assertEquals(type3.next(), "Requirement Relation", "2305843009213694295", "requirement-sideA", + "Requirement", "21", "subsystem-sideB", "SubSystem Requirement", "29", "Lexicographical_Ascending", + RelationMultiplicityEnum.ONE_TO_MANY); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); OseeDslResourceUtil.saveModel(model1, "osee:/text.osee", outputStream, false); @@ -96,19 +96,19 @@ public class ModelUtilTest { OseeDsl model1 = OseeDslResourceUtil.loadModel("osee:/text.osee", rawXTextData).getModel(); Assert.assertEquals(2, model1.getArtifactTypes().size()); Iterator<XArtifactType> type1 = model1.getArtifactTypes().iterator(); - DslAsserts.assertEquals(type1.next(), "Artifact", "0x0000000000000001", new String[0]); - DslAsserts.assertEquals(type1.next(), "Software Requirement", "0x0000000000000002", new String[] {"Artifact"}); + DslAsserts.assertEquals(type1.next(), "Artifact", "1", new String[0]); + DslAsserts.assertEquals(type1.next(), "Software Requirement", "2", new String[] {"Artifact"}); Assert.assertEquals(1, model1.getAttributeTypes().size()); Iterator<XAttributeType> type2 = model1.getAttributeTypes().iterator(); - DslAsserts.assertEquals(type2.next(), "Qualification Method", "0x1000000000000056", "StringAttribute", + DslAsserts.assertEquals(type2.next(), "Qualification Method", "1152921504606847062", "StringAttribute", "DefaultAttributeDataProvider", "0", "1", null, null, "test", null); Assert.assertEquals(1, model1.getRelationTypes().size()); Iterator<XRelationType> type3 = model1.getRelationTypes().iterator(); - DslAsserts.assertEquals(type3.next(), "Requirement Relation", "0x2000000000000163", "requirement-sideA", - "Software Requirement", "0x0000000000000002", "artifact-sideB", "Artifact", "0x0000000000000001", - "Lexicographical_Ascending", RelationMultiplicityEnum.ONE_TO_MANY); + DslAsserts.assertEquals(type3.next(), "Requirement Relation", "2305843009213694307", "requirement-sideA", + "Software Requirement", "2", "artifact-sideB", "Artifact", "1", "Lexicographical_Ascending", + RelationMultiplicityEnum.ONE_TO_MANY); Assert.assertEquals(3, model1.getArtifactMatchRefs().size()); Iterator<XArtifactMatcher> type4 = model1.getArtifactMatchRefs().iterator(); diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/testAccessModel.osee b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/testAccessModel.osee index d750aebc3a4..7d58021f3a1 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/testAccessModel.osee +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/testAccessModel.osee @@ -1,6 +1,5 @@ attributeType "Qualification Method" extends StringAttribute { - guid "BZPB25t9fRVnLuII6+wA" - uuid 0x1000000000000056 + guid "BZPB25t9fRVnLuII6+wA" id 1152921504606847062 dataProvider DefaultAttributeDataProvider min 0 max 1 @@ -8,8 +7,7 @@ attributeType "Qualification Method" extends StringAttribute { } relationType "Requirement Relation" { - guid "BOkzi3U9VTe2fcUz_9gA" - uuid 0x2000000000000163 + guid "BOkzi3U9VTe2fcUz_9gA" id 2305843009213694307 sideAName "requirement-sideA" sideAArtifactType "Software Requirement" sideBName "artifact-sideB" @@ -19,13 +17,11 @@ relationType "Requirement Relation" { } artifactType "Artifact" { - guid "BZOUrxO35x+LBZkEYzAA" - uuid 0x0000000000000001 + guid "BZOUrxO35x+LBZkEYzAA" id 1 } artifactType "Software Requirement" extends "Artifact" { - guid "BZO4PuM+Oz58hpAcTGwA" - uuid 0x0000000000000002 + guid "BZO4PuM+Oz58hpAcTGwA" id 2 } accessContext "System Context" { diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/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 1c5930a9691..e234db93f9f 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/testTypeModel.osee +++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/testTypeModel.osee @@ -1,6 +1,5 @@ attributeType "Name" extends StringAttribute { - guid "AAMFEcF1AzV7PKuHmxwA" - uuid 0x1000000000000070 + guid "AAMFEcF1AzV7PKuHmxwA" id 1152921504606847088 dataProvider DefaultAttributeDataProvider min 1 max 1 @@ -11,8 +10,7 @@ attributeType "Name" extends StringAttribute { } attributeType "Annotation" extends CompressedContentAttribute { - guid "AAMFEcWy0xc4e3tcemQA" - uuid 0x1000000000000076 + guid "AAMFEcWy0xc4e3tcemQA" id 1152921504606847094 dataProvider UriAttributeDataProvider min 0 max unlimited @@ -22,8 +20,7 @@ attributeType "Annotation" extends CompressedContentAttribute { } attributeType "WordML" extends WordAttribute { - guid "AAMFEcfcGS2V3SqQN2wA" - uuid 0x100000000000007A + guid "AAMFEcfcGS2V3SqQN2wA" id 1152921504606847098 dataProvider UriAttributeDataProvider min 0 max 1 @@ -35,8 +32,7 @@ attributeType "WordML" extends WordAttribute { } relationType "Requirement Relation" { - guid "BOkzi3U9VTe2fcUz_9gA" - uuid 0x2000000000000157 + guid "BOkzi3U9VTe2fcUz_9gA" id 2305843009213694295 sideAName "requirement-sideA" sideAArtifactType "Requirement" sideBName "subsystem-sideB" @@ -46,29 +42,24 @@ relationType "Requirement Relation" { } artifactType "Artifact" { - guid "AAMFDh6S7gRLupAMwywA" - uuid 0x0000000000000001 + guid "AAMFDh6S7gRLupAMwywA" id 1 attribute "Name" attribute "Annotation" } abstract artifactType "Requirement" extends "Artifact" { - guid "BOm4NmAq+HC1O2hkMagA" - uuid 0x0000000000000015 + guid "BOm4NmAq+HC1O2hkMagA" id 21 attribute "WordML" } artifactType "Software Requirement" extends "Requirement" { - guid "BOm+AIG2snNbAM5FFcwA" - uuid 0x0000000000000018 + guid "BOm+AIG2snNbAM5FFcwA" id 24 } artifactType "System Requirement" extends "Requirement" { - guid "BOnAaYTBOG68_Tw5Y_AA" - uuid 0x000000000000001E + guid "BOnAaYTBOG68_Tw5Y_AA" id 30 } artifactType "SubSystem Requirement" extends "Requirement" { - guid "BOnBhJ1XAFGKcrku3LgA" - uuid 0x000000000000001D + guid "BOnBhJ1XAFGKcrku3LgA" id 29 }
\ No newline at end of file |