diff options
author | jmisinco | 2011-12-07 18:44:24 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2011-12-07 18:44:24 +0000 |
commit | 705425d65ee4d06ace788a78ce9384bbcf35f607 (patch) | |
tree | 70c75cafd89e5845b982a4cb1ef3b1ab3ee56a24 | |
parent | dc48529d51c9541f99babcafc77683598146b33a (diff) | |
download | org.eclipse.osee-705425d65ee4d06ace788a78ce9384bbcf35f607.tar.gz org.eclipse.osee-705425d65ee4d06ace788a78ce9384bbcf35f607.tar.xz org.eclipse.osee-705425d65ee4d06ace788a78ce9384bbcf35f607.zip |
bug[ats_814KR]: TestUnitNames artifact moved to Common branch
3 files changed, 13 insertions, 12 deletions
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/store/ArtifactTestUnitStoreTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/store/ArtifactTestUnitStoreTest.java index 88aa2d10319..b5be22f42bb 100644 --- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/store/ArtifactTestUnitStoreTest.java +++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/store/ArtifactTestUnitStoreTest.java @@ -37,7 +37,6 @@ public class ArtifactTestUnitStoreTest { private static final String testInputData = "1|test1\n2|test2\n3|test3"; private Branch testBranch; - private static final String testArtifactGuid = "AEas7qndRl+k+g6YpkwA"; private CoverageItem createCoverageItem(TestUnitCache tc) throws OseeCoreException { CoverageUnit parent = new CoverageUnit(null, "Top", "C:/UserData/", null); @@ -51,7 +50,7 @@ public class ArtifactTestUnitStoreTest { Assert.assertTrue(TestUtil.isTestDb()); testBranch = BranchManager.createTopLevelBranch("TestBranch"); Artifact testArtifact = - ArtifactQuery.getOrCreate(testArtifactGuid, null, CoreArtifactTypes.GeneralData, testBranch); + ArtifactQuery.getOrCreate(ArtifactTestUnitStore.COVERAGE_GUID, null, CoreArtifactTypes.GeneralData, testBranch); testArtifact.setSoleAttributeFromString(CoreAttributeTypes.GeneralStringData, testInputData); } @@ -89,7 +88,7 @@ public class ArtifactTestUnitStoreTest { store.store(tc); Artifact testArtifact = - ArtifactQuery.getOrCreate(testArtifactGuid, null, CoreArtifactTypes.GeneralData, testBranch); + ArtifactQuery.getOrCreate(ArtifactTestUnitStore.COVERAGE_GUID, null, CoreArtifactTypes.GeneralData, testBranch); String actual = testArtifact.getSoleAttributeValueAsString(CoreAttributeTypes.GeneralStringData, ""); String expected = testInputData + "\n4|test10"; Assert.assertEquals(expected, actual); diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/ArtifactTestUnitStore.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/ArtifactTestUnitStore.java index f202387681c..8e3000c88b4 100644 --- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/ArtifactTestUnitStore.java +++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/ArtifactTestUnitStore.java @@ -20,6 +20,7 @@ import java.util.StringTokenizer; import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; +import org.eclipse.osee.framework.core.enums.CoreBranches; import org.eclipse.osee.framework.core.exception.OseeArgumentException; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.jdk.core.util.Strings; @@ -31,7 +32,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; */ public class ArtifactTestUnitStore implements ITestUnitStore { - public static final String COVERAGE_GUID = "AEas7qndRl+k+g6YpkwA"; + public static final String COVERAGE_GUID = "AhQuIIQa0Vkw4mswxhwA"; private final IOseeBranch branch; @@ -39,6 +40,10 @@ public class ArtifactTestUnitStore implements ITestUnitStore { this.branch = branch; } + public ArtifactTestUnitStore() { + this(CoreBranches.COMMON); + } + @Override public void load(TestUnitCache cache) throws OseeCoreException { String data = getAttributeData(); @@ -90,7 +95,7 @@ public class ArtifactTestUnitStore implements ITestUnitStore { StringTokenizer idName = new StringTokenizer(entries.nextToken(), "|"); if (idName.countTokens() == 2) { String id = idName.nextToken(); - String testUnitName = idName.nextToken(); + String testUnitName = idName.nextToken().trim(); if (Strings.isValid(id, testUnitName)) { int key = Integer.parseInt(id); cache.put(key, testUnitName); diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java index 34300ff8d5b..9eceb311adb 100644 --- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java +++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java @@ -13,9 +13,7 @@ package org.eclipse.osee.coverage.store; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.logging.Level; import org.eclipse.osee.coverage.event.CoverageChange; import org.eclipse.osee.coverage.event.CoverageEventType; @@ -47,8 +45,7 @@ import org.eclipse.osee.framework.skynet.core.utility.UsersByIds; public class OseeCoverageUnitStore extends OseeCoverageStore { private final CoverageUnit coverageUnit; - private static final Map<IOseeBranch, ITestUnitProvider> testUnitProviderCache = - new HashMap<IOseeBranch, ITestUnitProvider>(); + private static ITestUnitProvider testUnitProvider; public OseeCoverageUnitStore(ICoverage parent, Artifact artifact, CoverageOptionManager coverageOptionManager) throws OseeCoreException { super(null, artifact.getArtifactType(), artifact.getBranch()); @@ -118,10 +115,10 @@ public class OseeCoverageUnitStore extends OseeCoverageStore { } private ITestUnitProvider getTestUnitProvider() { - if (!testUnitProviderCache.containsKey(branch)) { - testUnitProviderCache.put(branch, new TestUnitCache(new ArtifactTestUnitStore(branch))); + if (testUnitProvider == null) { + testUnitProvider = new TestUnitCache(new ArtifactTestUnitStore()); } - return testUnitProviderCache.get(branch); + return testUnitProvider; } public void reloadItem(CoverageEventType eventType, CoverageItem currentCoverageItem, CoverageChange change, CoverageOptionManager coverageOptionManager) throws OseeCoreException { |