diff options
author | ddunne | 2011-05-18 19:37:14 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2011-05-18 19:37:14 +0000 |
commit | 2990406c32803b4b02552082b3613702568781a7 (patch) | |
tree | 07f54f36c56008dddb346355eb5b7913475a7cc3 /plugins/org.eclipse.osee.framework.skynet.core.test | |
parent | 1bb1a658ff009d68cdcef46391ae68f871a3dd31 (diff) | |
download | org.eclipse.osee-2990406c32803b4b02552082b3613702568781a7.tar.gz org.eclipse.osee-2990406c32803b4b02552082b3613702568781a7.tar.xz org.eclipse.osee-2990406c32803b4b02552082b3613702568781a7.zip |
refactor: Remove StaticIdManager and auto-caching of all StaticId attributes
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core.test')
-rw-r--r-- | plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java | 4 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactCacheQueryTest.java (renamed from plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/StaticIdManagerTest.java) | 128 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_getLastModified.java | 5 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationOrderingTest.java | 14 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEventTest.java | 6 |
5 files changed, 66 insertions, 91 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java index c18f677a828..b1eb38e25d5 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java @@ -13,6 +13,7 @@ package org.eclipse.osee.framework.skynet.core; import static org.junit.Assert.assertTrue; import org.eclipse.osee.framework.core.client.ClientSessionManager; import org.eclipse.osee.framework.jdk.core.util.OseeProperties; +import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCacheQueryTest; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPurgeTest; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTestSuite; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeInheritanceTest; @@ -28,7 +29,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.PurgeTransactionTest; import org.eclipse.osee.framework.skynet.core.artifact.RelationDeletionTest; import org.eclipse.osee.framework.skynet.core.artifact.RelationOrderingTest; import org.eclipse.osee.framework.skynet.core.artifact.ReplaceWithAttributeTest; -import org.eclipse.osee.framework.skynet.core.artifact.StaticIdManagerTest; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactLoaderTest; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQueryTestDemo; import org.eclipse.osee.framework.skynet.core.event.filter.ArtifactEventFiltersTest; @@ -89,7 +89,7 @@ import org.junit.runners.Suite; ConflictTest.class, ChangeManagerTest.class, RelationDeletionTest.class, - StaticIdManagerTest.class, + ArtifactCacheQueryTest.class, BranchStateTest.class, DuplicateHridTest.class, RelationOrderingTest.class, diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/StaticIdManagerTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactCacheQueryTest.java index 0d97a28b9ac..7903c51c712 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/StaticIdManagerTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactCacheQueryTest.java @@ -14,12 +14,10 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; - import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; @@ -34,9 +32,11 @@ import org.junit.Before; import org.junit.BeforeClass; /** + * Test unit for {@link ArtifactCacheQuery} + * * @author Donald G. Dunne */ -public class StaticIdManagerTest { +public class ArtifactCacheQueryTest { private static final String STATIC_ID_AAA = "aaa"; private static final String STATIC_ID_BBB = "bbb"; @@ -63,8 +63,8 @@ public class StaticIdManagerTest { for (String staticIdValue : ALL_STATIC_IDS) { Collection<Artifact> artifacts = - StaticIdManager.getArtifactsFromArtifactQuery(CoreArtifactTypes.GeneralData, staticIdValue, - BranchManager.getCommonBranch()); + ArtifactQuery.getArtifactListFromTypeAndAttribute(CoreArtifactTypes.GeneralData, + CoreAttributeTypes.StaticId, staticIdValue, BranchManager.getCommonBranch()); for (Artifact artifact : artifacts) { System.err.println("Search returned non-deleted " + artifact.getGuid()); } @@ -77,60 +77,64 @@ public class StaticIdManagerTest { assertTrue("Should be run on demo datbase.", TestUtil.isDemoDb()); } + /** + * Test method for (@link ArtifactCacheQuery.getOrCreateSingletonArtifactByText, ArtifactCache.getListByTextId} + */ @org.junit.Test public void testStaticIdsGettingCached() throws OseeCoreException { String staticId = "org." + GUID.create(); - 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.StaticId, staticId); - art.persist(); + Artifact artifact = + ArtifactCacheQuery.getOrCreateSingletonArtifactByText(CoreArtifactTypes.GeneralData, + CoreAttributeTypes.StaticId, staticId, BranchManager.getCommonBranch()); + assertNotNull(artifact); + artifact.addAttribute(CoreAttributeTypes.StaticId, staticId); + artifact.persist(); - artifacts = ArtifactCache.getArtifactsByStaticId(staticId); + Collection<Artifact> artifacts = ArtifactCache.getListByTextId(staticId, BranchManager.getCommonBranch()); assertTrue("Should be 1; Returned " + artifacts.size(), artifacts.size() == 1); - art.deleteAndPersist(); - artifacts = ArtifactCache.getArtifactsByStaticId(staticId); + artifact.deleteAndPersist(); + artifacts = ArtifactCache.getListByTextId(staticId, BranchManager.getCommonBranch()); assertTrue("Should be 0; Returned " + artifacts.size(), artifacts.isEmpty()); } /** - * Test method for - * {@link org.eclipse.osee.framework.skynet.core.artifact.StaticIdManager#getSingletonArtifact(java.lang.String, java.lang.String, org.eclipse.osee.framework.skynet.core.artifact.Branch, boolean)} - * . + * Test method for {@link ArtifactCacheQuery.getSingletonArtifactByText, + * ArtifactCacheQuery.getOrCreateSingletonArtifactByText} */ @org.junit.Test public void testGetSingletonArtifact() throws OseeCoreException { Artifact artifact = - StaticIdManager.getSingletonArtifact(CoreArtifactTypes.GeneralData, STATIC_ID_AAA, - BranchManager.getCommonBranch(), true); + ArtifactCacheQuery.getSingletonArtifactByText(CoreArtifactTypes.GeneralData, CoreAttributeTypes.StaticId, + STATIC_ID_AAA, BranchManager.getCommonBranch(), true); assertNull(artifact); artifact = - StaticIdManager.getOrCreateSingletonArtifact(CoreArtifactTypes.GeneralData, STATIC_ID_AAA, - BranchManager.getCommonBranch()); + ArtifactCacheQuery.getOrCreateSingletonArtifactByText(CoreArtifactTypes.GeneralData, + CoreAttributeTypes.StaticId, STATIC_ID_AAA, BranchManager.getCommonBranch()); assertNotNull(artifact); deleteArtifacts(Arrays.asList(artifact), STATIC_ID_AAA); } /** - * Test method for - * {@link org.eclipse.osee.framework.skynet.core.artifact.StaticIdManager#setSingletonAttributeValue(org.eclipse.osee.framework.skynet.core.artifact.Artifact, java.lang.String)} + * Test unif or {@link ArtifactCacheQuery.getSingletonArtifactByText, Artifact.setSingletonAttributeValue} */ @org.junit.Test public void testSetSingletonAttributeValue() throws OseeCoreException { // create artifact with two of same static id values Artifact artifact = ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralData, BranchManager.getCommonBranch()); + artifact.persist(); artifact.addAttribute(CoreAttributeTypes.StaticId, STATIC_ID_BBB); artifact.addAttribute(CoreAttributeTypes.StaticId, STATIC_ID_BBB); - artifact.persist(); + ArtifactCache.cacheByTextId(STATIC_ID_BBB, artifact); + ArtifactCache.cacheByTextId(STATIC_ID_BBB, artifact); // call to search for artifact with STATIC_ID_BBB Artifact artifactWithDoubleBbb = - StaticIdManager.getSingletonArtifact(CoreArtifactTypes.GeneralData, STATIC_ID_BBB, - BranchManager.getCommonBranch(), false); + ArtifactCacheQuery.getSingletonArtifactByText(CoreArtifactTypes.GeneralData, CoreAttributeTypes.StaticId, + STATIC_ID_BBB, BranchManager.getCommonBranch(), false); assertNotNull(artifactWithDoubleBbb); // should be two static id attributes @@ -141,7 +145,7 @@ public class StaticIdManagerTest { assertTrue("Expected 2 attributes; Returned " + count, count == 2); // call to set singleton which should resolve duplicates - StaticIdManager.setSingletonAttributeValue(artifactWithDoubleBbb, STATIC_ID_BBB); + artifactWithDoubleBbb.setSingletonAttributeValue(CoreAttributeTypes.StaticId, STATIC_ID_BBB); // should now be only one static id attributes count = artifactWithDoubleBbb.getAttributeCount(CoreAttributeTypes.StaticId); @@ -151,44 +155,13 @@ public class StaticIdManagerTest { } /** - * Test method for - * {@link org.eclipse.osee.framework.skynet.core.artifact.StaticIdManager#getArtifactsFromArtifactQuery(java.lang.String, java.lang.String, org.eclipse.osee.framework.skynet.core.artifact.Branch)} - * . - */ - @org.junit.Test - public void testGetArtifacts() throws OseeCoreException { - SkynetTransaction transaction = - new SkynetTransaction(BranchManager.getCommonBranch(), "Static Id Manager: create test artifacts"); - // Create three artifacts with ccc staticId - - for (int index = 0; index < 3; index++) { - Artifact artifact = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralData, BranchManager.getCommonBranch()); - StaticIdManager.setSingletonAttributeValue(artifact, STATIC_ID_CCC); - artifact.persist(transaction); - assertNotNull(artifact); - } - transaction.execute(); - - // search for static attributes - Collection<Artifact> artifacts = - StaticIdManager.getArtifactsFromArtifactQuery(CoreArtifactTypes.GeneralData, STATIC_ID_CCC, - BranchManager.getCommonBranch()); - assertTrue("Expected 3 artifacts; Returned " + artifacts.size(), artifacts.size() == 3); - - deleteArtifacts(artifacts, STATIC_ID_CCC); - } - - /** - * Test method for - * {@link org.eclipse.osee.framework.skynet.core.artifact.StaticIdManager#getSingletonArtifactOrException(java.lang.String, java.lang.String, org.eclipse.osee.framework.skynet.core.artifact.Branch)} - * . + * Test method for {@link ArtifactCacheQuery#getSingletonArtifactCacheByTextOrException} . */ @org.junit.Test public void testGetSingletonArtifactOrException() throws OseeCoreException { try { - StaticIdManager.getSingletonArtifactOrException(CoreArtifactTypes.GeneralData, STATIC_ID_DDD, - BranchManager.getCommonBranch()); + ArtifactCacheQuery.getSingletonArtifactByTextOrException(CoreArtifactTypes.GeneralData, + CoreAttributeTypes.StaticId, STATIC_ID_DDD, BranchManager.getCommonBranch()); fail("ArtifactDoesNotExist should have been thrown."); } catch (Exception ex) { assertTrue("Was not ArtifactDoesNotExist was: " + ex.getClass().getSimpleName(), @@ -201,7 +174,8 @@ public class StaticIdManagerTest { for (int index = 0; index < 2; index++) { Artifact artifact = ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralData, BranchManager.getCommonBranch()); - StaticIdManager.setSingletonAttributeValue(artifact, STATIC_ID_DDD); + artifact.setSingletonAttributeValue(CoreAttributeTypes.StaticId, STATIC_ID_DDD); + ArtifactCache.cacheByTextId(STATIC_ID_DDD, artifact); artifact.persist(transaction); assertNotNull(artifact); artifacts.add(artifact); @@ -209,8 +183,8 @@ public class StaticIdManagerTest { transaction.execute(); try { - StaticIdManager.getSingletonArtifactOrException(CoreArtifactTypes.GeneralData, STATIC_ID_DDD, - BranchManager.getCommonBranch()); + ArtifactCacheQuery.getSingletonArtifactByTextOrException(CoreArtifactTypes.GeneralData, + CoreAttributeTypes.StaticId, STATIC_ID_DDD, BranchManager.getCommonBranch()); fail("MultipleArtifactsExist should have been thrown"); } catch (Exception ex) { assertTrue("Was not MultipleArtifactsExist was: " + ex.getClass().getSimpleName(), @@ -220,6 +194,9 @@ public class StaticIdManagerTest { deleteArtifacts(artifacts, STATIC_ID_DDD); } + /** + * Test unit for {@link ArtifactCache.getListByTextId} that deleted artifacts not returned + */ private void deleteArtifacts(Collection<Artifact> toDelete, String staticId) throws OseeCoreException { if (!toDelete.isEmpty()) { if (toDelete.size() == 1) { @@ -236,15 +213,14 @@ public class StaticIdManagerTest { transaction.execute(); } - Collection<Artifact> artifacts = ArtifactCache.getArtifactsByStaticId(staticId); + Collection<Artifact> artifacts = ArtifactCache.getListByTextId(staticId, BranchManager.getCommonBranch()); assertTrue("Should be 0; Returned " + artifacts.size(), artifacts.isEmpty()); } } /** - * Test method for - * {@link org.eclipse.osee.framework.skynet.core.artifact.StaticIdManager#getSingletonArtifact(java.lang.String, java.lang.String, org.eclipse.osee.framework.skynet.core.artifact.Branch)} - * . + * Test method for {@link ArtifactCacheQuery.getOrCreateSingletonArtifactByText, + * ArtifactCacheQuery.getSingletonArtifactByText} . */ @org.junit.Test public void testGetSingletonArtifactStringStringBranch() throws OseeCoreException { @@ -254,8 +230,8 @@ public class StaticIdManagerTest { SkynetTransaction transaction = new SkynetTransaction(BranchManager.getCommonBranch(), "create single artifact with eee staticId"); Artifact artifact = - StaticIdManager.getOrCreateSingletonArtifact(CoreArtifactTypes.GeneralData, STATIC_ID_EEE, - BranchManager.getCommonBranch()); + ArtifactCacheQuery.getOrCreateSingletonArtifactByText(CoreArtifactTypes.GeneralData, + CoreAttributeTypes.StaticId, STATIC_ID_EEE, BranchManager.getCommonBranch()); artifact.persist(transaction); assertNotNull(artifact); transaction.execute(); @@ -264,14 +240,14 @@ public class StaticIdManagerTest { // test that singleton comes back artifact = - StaticIdManager.getSingletonArtifact(CoreArtifactTypes.GeneralData, STATIC_ID_EEE, - BranchManager.getCommonBranch(), false); + ArtifactCacheQuery.getSingletonArtifactByText(CoreArtifactTypes.GeneralData, CoreAttributeTypes.StaticId, + STATIC_ID_EEE, BranchManager.getCommonBranch(), false); assertNotNull(artifact); // create another artifact with eee staticId transaction = new SkynetTransaction(BranchManager.getCommonBranch(), "create another artifact with eee staticId"); artifact = ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralData, BranchManager.getCommonBranch()); - StaticIdManager.setSingletonAttributeValue(artifact, STATIC_ID_EEE); + artifact.setSingletonAttributeValue(CoreAttributeTypes.StaticId, STATIC_ID_EEE); artifact.persist(transaction); assertNotNull(artifact); transaction.execute(); @@ -279,15 +255,15 @@ public class StaticIdManagerTest { // test that there are now two artifacts with eee Collection<Artifact> artifacts = - StaticIdManager.getArtifactsFromArtifactQuery(CoreArtifactTypes.GeneralData, STATIC_ID_EEE, - BranchManager.getCommonBranch()); + ArtifactQuery.getArtifactListFromTypeAndAttribute(CoreArtifactTypes.GeneralData, CoreAttributeTypes.StaticId, + STATIC_ID_EEE, BranchManager.getCommonBranch()); assertTrue("Expected 2 artifacts; Returned " + artifacts.size(), artifacts.size() == 2); // test that call to get singleton does NOT exception try { artifact = - StaticIdManager.getSingletonArtifact(CoreArtifactTypes.GeneralData, STATIC_ID_EEE, - BranchManager.getCommonBranch(), false); + ArtifactCacheQuery.getSingletonArtifactByText(CoreArtifactTypes.GeneralData, CoreAttributeTypes.StaticId, + STATIC_ID_EEE, BranchManager.getCommonBranch(), false); assertNotNull(artifact); } catch (Exception ex) { fail("Exception should not have occurred " + ex.getLocalizedMessage()); diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_getLastModified.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_getLastModified.java index e67d518b9e7..b08430250dc 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_getLastModified.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact_getLastModified.java @@ -12,12 +12,11 @@ package org.eclipse.osee.framework.skynet.core.artifact; import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED; - import java.util.Collection; import java.util.Date; - import org.eclipse.osee.framework.core.data.SystemUser; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; +import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.skynet.core.UserManager; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; @@ -58,7 +57,7 @@ public class Artifact_getLastModified { previousModifyDate = artifact.getLastModified(); // Test post-modified - StaticIdManager.setSingletonAttributeValue(artifact, "this"); + artifact.setSingletonAttributeValue(CoreAttributeTypes.StaticId, "this"); Thread.sleep(1100); // just enough time to guarantee the date will be at least a second later artifact.persist(); diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationOrderingTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationOrderingTest.java index 72fd3cc7e62..4cf30fff07a 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationOrderingTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/RelationOrderingTest.java @@ -13,6 +13,7 @@ package org.eclipse.osee.framework.skynet.core.artifact; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Set; import org.eclipse.osee.framework.core.data.IArtifactType; @@ -24,6 +25,7 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.util.GUID; import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts; +import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; import org.junit.After; import org.junit.AfterClass; @@ -48,9 +50,9 @@ public class RelationOrderingTest { @BeforeClass @AfterClass public static void setupTeardown() throws Exception { - Set<Artifact> artsToDel = - StaticIdManager.getArtifactsFromArtifactQuery(CoreArtifactTypes.Folder, STATIC_ID_TO_DELETE, - BranchManager.getCommonBranch()); + Set<Artifact> artsToDel = new HashSet<Artifact>(); + artsToDel.addAll(ArtifactQuery.getArtifactListFromTypeAndAttribute(CoreArtifactTypes.Folder, + CoreAttributeTypes.StaticId, STATIC_ID_TO_DELETE, BranchManager.getCommonBranch())); if (artsToDel.size() > 0) { new PurgeArtifacts(artsToDel).execute(); Thread.sleep(5000); @@ -187,7 +189,7 @@ public class RelationOrderingTest { ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, BranchManager.getCommonBranch(), "Main Folder - " + guid); mainFolder.persist(transaction); - StaticIdManager.setSingletonAttributeValue(mainFolder, STATIC_ID_TO_DELETE); + mainFolder.setSingletonAttributeValue(CoreAttributeTypes.StaticId, STATIC_ID_TO_DELETE); OseeSystemArtifacts.getDefaultHierarchyRootArtifact(BranchManager.getCommonBranch()).addChild(mainFolder); List<Artifact> children = new ArrayList<Artifact>(); for (int x = 0; x < 3; x++) { @@ -195,7 +197,7 @@ public class RelationOrderingTest { ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, BranchManager.getCommonBranch(), "New Child " + x + " - " + guid); children.add(childArt); - StaticIdManager.setSingletonAttributeValue(childArt, STATIC_ID_TO_DELETE); + childArt.setSingletonAttributeValue(CoreAttributeTypes.StaticId, STATIC_ID_TO_DELETE); mainFolder.addChild(childArt); childArt.persist(transaction); } @@ -206,7 +208,7 @@ public class RelationOrderingTest { ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, BranchManager.getCommonBranch(), "New Artifact " + guid); mainFolder.addChild(newArtifact); - StaticIdManager.setSingletonAttributeValue(newArtifact, STATIC_ID_TO_DELETE); + newArtifact.setSingletonAttributeValue(CoreAttributeTypes.StaticId, STATIC_ID_TO_DELETE); newArtifact.persist(); for (Artifact child : children) { diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEventTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEventTest.java index 2f228c4c8b6..380ba3f3f85 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEventTest.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/model/ArtifactEventTest.java @@ -15,7 +15,6 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; - import org.eclipse.osee.framework.core.data.IRelationType; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; @@ -37,7 +36,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.artifact.ChangeArtifactType; -import org.eclipse.osee.framework.skynet.core.artifact.StaticIdManager; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; import org.eclipse.osee.framework.skynet.core.event.FrameworkEventUtil; import org.eclipse.osee.framework.skynet.core.event.OseeEventManager; @@ -242,7 +240,7 @@ public class ArtifactEventTest { private void testArtifactRelationEvents__modifyArtifact(Artifact newArt) throws Exception { clearEventCollections(); - StaticIdManager.setSingletonAttributeValue(newArt, "this"); + newArt.setSingletonAttributeValue(CoreAttributeTypes.StaticId, "this"); newArt.persist(); Assert.assertEquals(1, resultEventArtifacts.size()); @@ -828,7 +826,7 @@ public class ArtifactEventTest { Assert.assertEquals(1, OseeEventManager.getNumberOfListeners()); // reload Artifact - StaticIdManager.setSingletonAttributeValue(newArt, "this"); + newArt.setSingletonAttributeValue(CoreAttributeTypes.StaticId, "this"); Assert.assertTrue(newArt.isDirty()); newArt.reloadAttributesAndRelations(); Assert.assertFalse(newArt.isDirty()); |