diff options
author | rbrooks | 2010-08-09 20:54:58 +0000 |
---|---|---|
committer | rbrooks | 2010-08-09 20:54:58 +0000 |
commit | fea50b1a2ced0f17a0059b4524656abf7c419ce6 (patch) | |
tree | ea15ea6c209b6fce35c8d0ee59399ddede0f2854 /plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases | |
parent | a6267b1b107c6c62cece1ed1ed2351b09aa96957 (diff) | |
download | org.eclipse.osee-fea50b1a2ced0f17a0059b4524656abf7c419ce6.tar.gz org.eclipse.osee-fea50b1a2ced0f17a0059b4524656abf7c419ce6.tar.xz org.eclipse.osee-fea50b1a2ced0f17a0059b4524656abf7c419ce6.zip |
converted more string based type references to use type tokens
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases')
10 files changed, 66 insertions, 68 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactLoaderTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactLoaderTest.java index 99162f68acc..21dada1dee3 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactLoaderTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactLoaderTest.java @@ -84,7 +84,7 @@ public class ArtifactLoaderTest { "ArtifactLoaderTest", BranchManager.getCommonBranch()); for (Artifact artifact : artifacts) { artifact.setName("ArtifactLoaderTest"); - artifact.addAttribute(CoreAttributeTypes.DEFAULT_MAIL_SERVER, ATTRIBUTE_VALUE); + artifact.addAttribute(CoreAttributeTypes.DefaultMailServer, ATTRIBUTE_VALUE); artifact.persist(transaction); } transaction.execute(); @@ -125,8 +125,8 @@ public class ArtifactLoaderTest { Assert.assertEquals(NUM_ARTIFACTS, artifacts.size()); for (Artifact artifact : artifacts) { - Assert.assertEquals(ATTRIBUTE_VALUE, artifact.getSoleAttributeValue(CoreAttributeTypes.DEFAULT_MAIL_SERVER)); - Assert.assertEquals(1, artifact.getAttributesToStringList(CoreAttributeTypes.DEFAULT_MAIL_SERVER).size()); + Assert.assertEquals(ATTRIBUTE_VALUE, artifact.getSoleAttributeValue(CoreAttributeTypes.DefaultMailServer)); + Assert.assertEquals(1, artifact.getAttributesToStringList(CoreAttributeTypes.DefaultMailServer).size()); } System.out.println("Completed"); diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactPurgeTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactPurgeTest.java index a843ff135b8..7cfdb0d22d4 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactPurgeTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ArtifactPurgeTest.java @@ -109,7 +109,7 @@ public class ArtifactPurgeTest { // make more changes to artifacts for (Artifact softArt : softArts) { - softArt.addAttribute(CoreAttributeTypes.STATIC_ID, getClass().getSimpleName()); + softArt.addAttribute(CoreAttributeTypes.StaticId, getClass().getSimpleName()); softArt.persist(); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/Artifact_setAttributeValues.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/Artifact_setAttributeValues.java index eab09c61b91..9a743229433 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/Artifact_setAttributeValues.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/Artifact_setAttributeValues.java @@ -52,48 +52,48 @@ public class Artifact_setAttributeValues { Branch branch = BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid()); Assert.assertNotNull(branch); Artifact artifact = ArtifactTypeManager.addArtifact("General Document", branch, getClass().getSimpleName()); - artifact.setAttributeValues(CoreAttributeTypes.STATIC_ID, firstSet); + artifact.setAttributeValues(CoreAttributeTypes.StaticId, firstSet); artifact.persist(); - assertTrue(Collections.isEqual(firstSet, artifact.getAttributesToStringList(CoreAttributeTypes.STATIC_ID))); + assertTrue(Collections.isEqual(firstSet, artifact.getAttributesToStringList(CoreAttributeTypes.StaticId))); } @org.junit.Test public void testSetAttributeValuesAddOne() throws Exception { Artifact artifact = getArtifact(); - artifact.setAttributeValues(CoreAttributeTypes.STATIC_ID, addOneSet); + artifact.setAttributeValues(CoreAttributeTypes.StaticId, addOneSet); artifact.persist(); - assertTrue(Collections.isEqual(addOneSet, artifact.getAttributesToStringList(CoreAttributeTypes.STATIC_ID))); + assertTrue(Collections.isEqual(addOneSet, artifact.getAttributesToStringList(CoreAttributeTypes.StaticId))); } @org.junit.Test public void testSetAttributeValuesAddOneRemoveOne() throws Exception { Artifact artifact = getArtifact(); - artifact.setAttributeValues(CoreAttributeTypes.STATIC_ID, addOneRemoveOneSet); + artifact.setAttributeValues(CoreAttributeTypes.StaticId, addOneRemoveOneSet); artifact.persist(); assertTrue(Collections.isEqual(addOneRemoveOneSet, - artifact.getAttributesToStringList(CoreAttributeTypes.STATIC_ID))); + artifact.getAttributesToStringList(CoreAttributeTypes.StaticId))); } @org.junit.Test public void testSetAttributeValuesRemoveAll() throws Exception { Artifact artifact = getArtifact(); - artifact.setAttributeValues(CoreAttributeTypes.STATIC_ID, emptySet); + artifact.setAttributeValues(CoreAttributeTypes.StaticId, emptySet); artifact.persist(); - assertTrue(artifact.getAttributesToStringList(CoreAttributeTypes.STATIC_ID).isEmpty()); + assertTrue(artifact.getAttributesToStringList(CoreAttributeTypes.StaticId).isEmpty()); } @org.junit.Test public void testSetAttributeValuesWithDuplicates() throws Exception { Artifact artifact = getArtifact(); - artifact.setAttributeValues(CoreAttributeTypes.STATIC_ID, addDuplicates_set); + artifact.setAttributeValues(CoreAttributeTypes.StaticId, addDuplicates_set); artifact.persist(); assertTrue(Collections.isEqual(addDuplicates_result, - artifact.getAttributesToStringList(CoreAttributeTypes.STATIC_ID))); + artifact.getAttributesToStringList(CoreAttributeTypes.StaticId))); } @AfterClass diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/BranchPurgeTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/BranchPurgeTest.java index 83d73360b56..37bbfa9ece4 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/BranchPurgeTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/BranchPurgeTest.java @@ -80,7 +80,7 @@ public class BranchPurgeTest { // make more changes to artifacts for (Artifact softArt : softArts) { - softArt.addAttribute(CoreAttributeTypes.STATIC_ID, getClass().getSimpleName()); + softArt.addAttribute(CoreAttributeTypes.StaticId, getClass().getSimpleName()); softArt.persist(); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ChangeManagerTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ChangeManagerTest.java index fc090d1df31..5cad7f0923c 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ChangeManagerTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ChangeManagerTest.java @@ -83,9 +83,9 @@ public class ChangeManagerTest { modArtifact = ArtifactQuery.getArtifactFromId(modArtifact.getArtId(), branch); assertTrue("Check artifact new", checkArtifactModType(newArtifact, ModificationType.NEW)); - newArtifact.setSoleAttributeFromString(CoreAttributeTypes.WORD_TEMPLATE_CONTENT, "new content"); + newArtifact.setSoleAttributeFromString(CoreAttributeTypes.WordTemplateContent, "new content"); assertTrue("Check artifact is still new", checkArtifactModType(newArtifact, ModificationType.NEW)); - modArtifact.setSoleAttributeFromString(CoreAttributeTypes.WORD_TEMPLATE_CONTENT, "changed content"); + modArtifact.setSoleAttributeFromString(CoreAttributeTypes.WordTemplateContent, "changed content"); modArtifact.persist(); assertTrue("Check artifact has changed", checkArtifactModType(modArtifact, ModificationType.NEW)); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ConflictTestManager.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ConflictTestManager.java index 94c61a04a37..5cbdf1182cf 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ConflictTestManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/ConflictTestManager.java @@ -15,6 +15,7 @@ import java.util.Collection; import java.util.Date; import java.util.LinkedList; import java.util.List; +import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchType; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; @@ -29,6 +30,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager; import org.eclipse.osee.framework.skynet.core.artifact.Attribute; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; +import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager; import org.eclipse.osee.framework.skynet.core.attribute.BooleanAttribute; import org.eclipse.osee.framework.skynet.core.attribute.DateAttribute; import org.eclipse.osee.framework.skynet.core.attribute.FloatingPointAttribute; @@ -78,7 +80,7 @@ public class ConflictTestManager { public static int REVERT_REL_LINK_QUERY = 6; protected static class AttributeValue { - protected String attributeName; + protected IAttributeType attributeType; protected String sourceValue; protected String destValue; protected String mergeValue; @@ -86,12 +88,12 @@ public class ConflictTestManager { protected boolean sourceDeleted; protected boolean destinationDeleted; - protected AttributeValue(String attributeName, String sourceValue, String destValue, String mergeValue, Class<?> clas) { + protected AttributeValue(String attributeName, String sourceValue, String destValue, String mergeValue, Class<?> clas) throws OseeCoreException { this(attributeName, sourceValue, destValue, mergeValue, clas, false, false); } - protected AttributeValue(String attributeName, String sourceValue, String destValue, String mergeValue, Class<?> clas, boolean sourceDeleted, boolean destinationDeleted) { - this.attributeName = attributeName; + protected AttributeValue(String attributeName, String sourceValue, String destValue, String mergeValue, Class<?> clas, boolean sourceDeleted, boolean destinationDeleted) throws OseeCoreException { + this.attributeType = AttributeTypeManager.getType(attributeName); this.sourceValue = sourceValue; this.destValue = destValue; this.mergeValue = mergeValue; @@ -100,12 +102,8 @@ public class ConflictTestManager { this.destinationDeleted = destinationDeleted; } - protected AttributeValue(String attributeName, String sourceValue, Class<?> clas) { - this.attributeName = attributeName; - this.sourceValue = sourceValue; - this.clas = clas; - sourceDeleted = false; - destinationDeleted = false; + protected AttributeValue(String attributeName, String sourceValue, Class<?> clas) throws OseeCoreException { + this(attributeName, sourceValue, null, null, clas); } } @@ -161,7 +159,7 @@ public class ConflictTestManager { createConflictDefinitions(); destBranch = BranchManager.createWorkingBranch(DemoSawBuilds.SAW_Bld_1, DEST_BRANCH, null); - Artifact rootArtifact = ArtifactQuery.getArtifactFromAttribute(CoreAttributeTypes.NAME, FOLDER, destBranch); + Artifact rootArtifact = ArtifactQuery.getArtifactFromAttribute(CoreAttributeTypes.Name, FOLDER, destBranch); // Add artifacts onto the destination Branch for (int i = 0; i < NUMBER_OF_ARTIFACTS; i++) { @@ -175,7 +173,7 @@ public class ConflictTestManager { rootArtifact.addNewChild(RelationOrderBaseTypes.USER_DEFINED, artType, "Test Artifact Number " + i); } for (AttributeValue value : conflictDefs[i].newAttributes) { - destArtifacts[i].addAttribute(value.attributeName, stringToObject(value.clas, value.sourceValue)); + destArtifacts[i].addAttribute(value.attributeType, stringToObject(value.clas, value.sourceValue)); } destArtifacts[i].persist(); } @@ -192,11 +190,11 @@ public class ConflictTestManager { for (AttributeValue value : conflictDefs[i].values) { // source objects if (value.sourceDeleted) { - sourceArtifacts[i].getSoleAttribute(value.attributeName).delete(); + sourceArtifacts[i].getSoleAttribute(value.attributeType).delete(); } else { if (value.sourceValue != null) { conflictDefs[i].sourceModified = true; - sourceArtifacts[i].setSoleAttributeValue(value.attributeName, + sourceArtifacts[i].setSoleAttributeValue(value.attributeType, stringToObject(value.clas, value.sourceValue)); } if (value.sourceValue != null && value.destValue != null) { @@ -205,10 +203,10 @@ public class ConflictTestManager { } // destination objects if (value.destinationDeleted) { - destArtifacts[i].getSoleAttribute(value.attributeName).delete(); + destArtifacts[i].getSoleAttribute(value.attributeType).delete(); } else if (value.destValue != null) { conflictDefs[i].destModified = true; - destArtifacts[i].setSoleAttributeValue(value.attributeName, stringToObject(value.clas, value.destValue)); + destArtifacts[i].setSoleAttributeValue(value.attributeType, stringToObject(value.clas, value.destValue)); } } sourceArtifacts[i].persist(); @@ -251,8 +249,8 @@ public class ConflictTestManager { modification.name); break; case ATTRIBUTE: - createAttribute((Artifact) modification.object, modification.name, modification.clas, - modification.value); + createAttribute((Artifact) modification.object, AttributeTypeManager.getType(modification.name), + modification.clas, modification.value); break; case RELATION: createRelation((Artifact) modification.object, (Artifact) modification.object2); @@ -270,8 +268,8 @@ public class ConflictTestManager { modification.name).deleteAndPersist(); break; case ATTRIBUTE: - createAttribute((Artifact) modification.object, modification.name, modification.clas, - modification.value); + createAttribute((Artifact) modification.object, AttributeTypeManager.getType(modification.name), + modification.clas, modification.value); ((Artifact) modification.object).deleteSoleAttribute(modification.name); ((Artifact) modification.object).persist(); break; @@ -293,7 +291,7 @@ public class ConflictTestManager { } protected static Artifact createArtifact(int rootArtifactId, Branch branch, String type, String name) throws OseeCoreException { - Artifact rootArtifact = ArtifactQuery.getArtifactFromAttribute(CoreAttributeTypes.NAME, FOLDER, branch); + Artifact rootArtifact = ArtifactQuery.getArtifactFromAttribute(CoreAttributeTypes.Name, FOLDER, branch); if (rootArtifactId > 0 && rootArtifactId < NUMBER_OF_ARTIFACTS) { if (branch.equals(destArtifacts[0].getBranch())) { rootArtifact = destArtifacts[rootArtifactId]; @@ -309,10 +307,10 @@ public class ConflictTestManager { return child; } - protected static Attribute<?> createAttribute(Artifact artifact, String name, Class<?> clas, String value) throws OseeCoreException { - artifact.addAttribute(name, stringToObject(clas, value)); + protected static Attribute<?> createAttribute(Artifact artifact, IAttributeType attributeType, Class<?> clas, String value) throws OseeCoreException { + artifact.addAttribute(attributeType, stringToObject(clas, value)); artifact.persist(); - return artifact.getSoleAttribute(name); + return artifact.getSoleAttribute(attributeType); } protected static RelationLink createRelation(Artifact artifact, Artifact artifactB) throws OseeCoreException { @@ -402,7 +400,7 @@ public class ConflictTestManager { public static void resolveAttributeConflict(AttributeConflict conflict) throws Exception { int sourceArtifactId = conflict.getSourceArtifact().getArtId(); - String attributeName = conflict.getSourceAttribute(true).getAttributeType().getName(); + IAttributeType attributeType = conflict.getSourceAttribute(true).getAttributeType(); AttributeValue aValue = null; int artNumber = -1; for (int i = 0; i < NUMBER_OF_ARTIFACTS; i++) { @@ -415,21 +413,21 @@ public class ConflictTestManager { // The relation order attribute of the parent folder will have a RelationOrder // conflict that is not relevant to this test. -- RS if (conflict.getArtifactName().equals("System Requirements") && conflict.getAttributeType().equals( - CoreAttributeTypes.RELATION_ORDER)) { + CoreAttributeTypes.RelationOrder)) { return; } else { throw new Exception("Source Artifact " + sourceArtifactId + " could not be found in the list of artifatcs"); } } for (AttributeValue value : conflictDefs[artNumber].values) { - if (value.attributeName.equals(attributeName)) { + if (value.attributeType.equals(attributeType)) { aValue = value; break; } } if (aValue == null) { throw new Exception( - "Source Artifact " + sourceArtifactId + " does not have a conflict for the" + attributeName + " attribute"); + "Source Artifact " + sourceArtifactId + " does not have a conflict for the" + attributeType + " attribute"); } if (aValue.mergeValue == null) { throw new Exception("Merge Value has a null value so no resolution possible"); @@ -461,15 +459,15 @@ public class ConflictTestManager { expected = value.sourceValue; } if (value.sourceDeleted) { - if (destArtifacts[i].getSoleAttributeValueAsString(value.attributeName, "Deleted").equals("Deleted")) { + if (destArtifacts[i].getSoleAttributeValueAsString(value.attributeType, "Deleted").equals("Deleted")) { System.err.println("The attribute should have been deleted but wasn't"); return false; } } else if (!stringToObject(value.clas, expected).toString().equals( - destArtifacts[i].getSoleAttributeValueAsString(value.attributeName, " ")) && !destArtifacts[i].isDeleted()) { - System.err.println("Expected the " + value.attributeName + " attribute to have a value of " + stringToObject( + destArtifacts[i].getSoleAttributeValueAsString(value.attributeType, " ")) && !destArtifacts[i].isDeleted()) { + System.err.println("Expected the " + value.attributeType + " attribute to have a value of " + stringToObject( value.clas, expected) + " but got " + destArtifacts[i].getSoleAttributeValueAsString( - value.attributeName, " ") + " for Artifact " + destArtifacts[i].getArtId() + " conflict index: " + i); + value.attributeType, " ") + " for Artifact " + destArtifacts[i].getArtId() + " conflict index: " + i); return false; } } @@ -493,7 +491,7 @@ public class ConflictTestManager { sourceArtifacts[7])); } - public static void createConflictDefinitions() { + public static void createConflictDefinitions() throws OseeCoreException { for (int i = 0; i < NUMBER_OF_ARTIFACTS; i++) { conflictDefs[i] = new ConflictDefinition(); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/NativeArtifactTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/NativeArtifactTest.java index 06eb5996af9..09b6d109b09 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/NativeArtifactTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/NativeArtifactTest.java @@ -47,22 +47,22 @@ public class NativeArtifactTest { CsvArtifact.getCsvArtifact(getClass().getSimpleName(), BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1), true); assertNotNull(csvArtifact); Artifact artifact = csvArtifact.getArtifact(); - assertTrue(artifact.isAttributeTypeValid(CoreAttributeTypes.NATIVE_CONTENT)); - assertTrue(artifact.isAttributeTypeValid(CoreAttributeTypes.NATIVE_EXTENSION)); + assertTrue(artifact.isAttributeTypeValid(CoreAttributeTypes.NativeContent)); + assertTrue(artifact.isAttributeTypeValid(CoreAttributeTypes.Extension)); } @org.junit.Test public void testGetFileExtension() throws Exception { Artifact nativeArtifact = getNativeArtifact(); - assertTrue(nativeArtifact.getSoleAttributeValue(CoreAttributeTypes.NATIVE_EXTENSION.getName(), "").equals("csv")); + assertTrue(nativeArtifact.getSoleAttributeValue(CoreAttributeTypes.Extension.getName(), "").equals("csv")); } @org.junit.Test public void testSetAndGetValueAsString() throws Exception { Artifact nativeArtifact = getNativeArtifact(); - nativeArtifact.setSoleAttributeFromString(CoreAttributeTypes.NATIVE_CONTENT.getName(), "hello world"); + nativeArtifact.setSoleAttributeFromString(CoreAttributeTypes.NativeContent.getName(), "hello world"); nativeArtifact.persist(); - String content = nativeArtifact.getSoleAttributeValueAsString(CoreAttributeTypes.NATIVE_CONTENT.getName(), ""); + String content = nativeArtifact.getSoleAttributeValueAsString(CoreAttributeTypes.NativeContent.getName(), ""); assertEquals("hello world", content); } @@ -71,11 +71,11 @@ public class NativeArtifactTest { File file = OseeData.getFile(GUID.create() + ".txt"); Lib.writeStringToFile("hello world", file); Artifact nativeArtifact = getNativeArtifact(); - nativeArtifact.setSoleAttributeFromStream(CoreAttributeTypes.NATIVE_CONTENT.getName(), new FileInputStream(file)); + nativeArtifact.setSoleAttributeFromStream(CoreAttributeTypes.NativeContent, new FileInputStream(file)); nativeArtifact.persist(); InputStream inputStream = null; try { - inputStream = nativeArtifact.getSoleAttributeValue(CoreAttributeTypes.NATIVE_CONTENT.getName(), null); + inputStream = nativeArtifact.getSoleAttributeValue(CoreAttributeTypes.NativeContent.getName(), null); String content = Lib.inputStreamToString(inputStream); assertEquals("hello world", content); } finally { diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/PurgeTransactionTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/PurgeTransactionTest.java index 0b60360d695..3b4c818d402 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/PurgeTransactionTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/PurgeTransactionTest.java @@ -93,7 +93,7 @@ public class PurgeTransactionTest { DbUtil.getTableRowCounts(preModifyCount, tables); modifyTransaction = new SkynetTransaction(branch, "Purge Transaction Test"); for (Artifact softArt : softArts) { - softArt.addAttribute(CoreAttributeTypes.STATIC_ID, getClass().getSimpleName()); + softArt.addAttribute(CoreAttributeTypes.StaticId, getClass().getSimpleName()); softArt.persist(modifyTransaction); } modifyId = modifyTransaction.getTransactionNumber(); diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/RelationOrderingTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/RelationOrderingTest.java index 381d0fe7034..cdf8defe824 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/RelationOrderingTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/RelationOrderingTest.java @@ -101,7 +101,7 @@ public class RelationOrderingTest { checkUserDefined(); parent.setRelationOrder(CoreRelationTypes.Default_Hierarchical__Child, RelationOrderBaseTypes.LEXICOGRAPHICAL_ASC); - Attribute<Object> attribute = parent.getSoleAttribute(CoreAttributeTypes.RELATION_ORDER); + Attribute<Object> attribute = parent.getSoleAttribute(CoreAttributeTypes.RelationOrder); assertTrue("Setting the attribute back to the default type did not cause an attribute to be deleted", (attribute == null || attribute.isDeleted())); @@ -124,7 +124,7 @@ public class RelationOrderingTest { parent.setRelationOrder(CoreRelationTypes.Default_Hierarchical__Child, RelationOrderBaseTypes.LEXICOGRAPHICAL_ASC); - attribute = parent.getSoleAttribute(CoreAttributeTypes.RELATION_ORDER); + attribute = parent.getSoleAttribute(CoreAttributeTypes.RelationOrder); assertTrue("The attribute was deleted even though there was a still a non default sort order on the artifact.", (attribute != null)); @@ -170,7 +170,7 @@ public class RelationOrderingTest { parent.deleteRelation(CoreRelationTypes.Default_Hierarchical__Child, child3); - String orderString = parent.getSoleAttributeValue(CoreAttributeTypes.RELATION_ORDER); + String orderString = parent.getSoleAttributeValue(CoreAttributeTypes.RelationOrder); assertFalse(orderString.contains(artifactGuid)); diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/StaticIdManagerTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/StaticIdManagerTest.java index 003d4e66d27..ad3ce9544ce 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/StaticIdManagerTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/StaticIdManagerTest.java @@ -56,7 +56,7 @@ public class StaticIdManagerTest { SkynetTransaction transaction = new SkynetTransaction(BranchManager.getCommonBranch(), "Static ID Manager test cleanup for re-run"); for (String staticIdValue : ALL_STATIC_IDS) { - for (Artifact artifact : ArtifactQuery.getArtifactListFromAttribute(CoreAttributeTypes.STATIC_ID, + for (Artifact artifact : ArtifactQuery.getArtifactListFromAttribute(CoreAttributeTypes.StaticId, staticIdValue, BranchManager.getCommonBranch())) { artifact.deleteAndPersist(transaction); System.out.println("Deleting " + artifact.getGuid()); @@ -86,7 +86,7 @@ public class StaticIdManagerTest { Collection<Artifact> artifacts = ArtifactCache.getArtifactsByStaticId(staticId); assertTrue("Should be 0; Returned " + artifacts.size(), artifacts.isEmpty()); Artifact art = ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralData, BranchManager.getCommonBranch()); - art.addAttribute(CoreAttributeTypes.STATIC_ID, staticId); + art.addAttribute(CoreAttributeTypes.StaticId, staticId); art.persist(); artifacts = ArtifactCache.getArtifactsByStaticId(staticId); @@ -128,8 +128,8 @@ public class StaticIdManagerTest { // create artifact with two of same static id values Artifact artifact = ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralData, BranchManager.getCommonBranch()); - artifact.addAttribute(CoreAttributeTypes.STATIC_ID, STATIC_ID_BBB); - artifact.addAttribute(CoreAttributeTypes.STATIC_ID, STATIC_ID_BBB); + artifact.addAttribute(CoreAttributeTypes.StaticId, STATIC_ID_BBB); + artifact.addAttribute(CoreAttributeTypes.StaticId, STATIC_ID_BBB); artifact.persist(); // call to search for artifact with STATIC_ID_BBB @@ -139,17 +139,17 @@ public class StaticIdManagerTest { assertNotNull(artifactWithDoubleBbb); // should be two static id attributes - int count = artifactWithDoubleBbb.getAttributes(CoreAttributeTypes.STATIC_ID).size(); + int count = artifactWithDoubleBbb.getAttributes(CoreAttributeTypes.StaticId).size(); assertTrue("Expected 2 attributes; Returned " + count, count == 2); - count = artifactWithDoubleBbb.getAttributeCount(CoreAttributeTypes.STATIC_ID); + count = artifactWithDoubleBbb.getAttributeCount(CoreAttributeTypes.StaticId); assertTrue("Expected 2 attributes; Returned " + count, count == 2); // call to set singleton which should resolve duplicates StaticIdManager.setSingletonAttributeValue(artifactWithDoubleBbb, STATIC_ID_BBB); // should now be only one static id attributes - count = artifactWithDoubleBbb.getAttributeCount(CoreAttributeTypes.STATIC_ID); + count = artifactWithDoubleBbb.getAttributeCount(CoreAttributeTypes.StaticId); assertTrue("Expected 1 attributes; Returned " + count, count == 1); deleteArtifacts(Arrays.asList(artifact), STATIC_ID_BBB); |