Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2011-08-30 22:33:28 +0000
committerRyan D. Brooks2011-08-30 22:33:28 +0000
commitfad4e4a36f3c7955b1bb37bfbf2a1b07f9321b9b (patch)
tree5bb3519e28391b71be3db1446f44974b8999f241
parent44834d49f03702c2bb8c965f806c3db484c55a32 (diff)
downloadorg.eclipse.osee-fad4e4a36f3c7955b1bb37bfbf2a1b07f9321b9b.tar.gz
org.eclipse.osee-fad4e4a36f3c7955b1bb37bfbf2a1b07f9321b9b.tar.xz
org.eclipse.osee-fad4e4a36f3c7955b1bb37bfbf2a1b07f9321b9b.zip
feature[ats_M1Y56]: Fix attribute type validity to use branch tokens
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchToken.java17
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/ConflictTest.java8
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/ClientArtifactTypeAccessor.java12
4 files changed, 15 insertions, 26 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java
index 7f7b3fc9b95..0aa6daec5f4 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java
@@ -18,8 +18,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.core.data.BranchToken;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.dsl.integration.internal.Activator;
import org.eclipse.osee.framework.core.dsl.integration.util.HexUtil;
import org.eclipse.osee.framework.core.dsl.integration.util.OseeUtil;
@@ -162,7 +162,7 @@ public class XTextToOseeTypeOperation extends AbstractOperation {
} else {
IOseeBranch branch = branchCache.getByGuid(branchGuid);
if (branch == null) {
- branch = new BranchToken(branchGuid, branchGuid);
+ branch = TokenFactory.createBranch(branchGuid, branchGuid);
}
return branch;
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchToken.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchToken.java
deleted file mode 100644
index 82ac735de83..00000000000
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/BranchToken.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.core.data;
-
-public final class BranchToken extends NamedIdentity<String> implements IOseeBranch {
- public BranchToken(String guid, String name) {
- super(guid, name);
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/ConflictTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/ConflictTest.java
index f5ede90e4f9..6059b0bcc20 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/ConflictTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/ConflictTest.java
@@ -15,9 +15,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-
import java.util.Collection;
-
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.osee.framework.core.enums.BranchState;
@@ -36,10 +34,13 @@ import org.eclipse.osee.framework.skynet.core.conflict.AttributeConflict;
import org.eclipse.osee.framework.skynet.core.conflict.Conflict;
import org.eclipse.osee.framework.skynet.core.conflict.ConflictManagerExternal;
import org.eclipse.osee.framework.skynet.core.conflict.RelationConflict;
+import org.eclipse.osee.framework.skynet.core.rule.OseeHousekeepingRule;
import org.eclipse.osee.support.test.util.TestUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.rules.MethodRule;
/**
* @author Jeff C. Phillips
@@ -49,6 +50,9 @@ public class ConflictTest {
private static final boolean DEBUG =
"TRUE".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.osee.framework.skynet.core.test/debug/Junit"));
+ @Rule
+ public MethodRule oseeHousekeepingRule = new OseeHousekeepingRule();
+
@BeforeClass
public static void setUp() throws Exception {
ConflictTestManager.initializeConflictTest();
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/ClientArtifactTypeAccessor.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/ClientArtifactTypeAccessor.java
index f8562cefefa..48f342a1ddb 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/ClientArtifactTypeAccessor.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/ClientArtifactTypeAccessor.java
@@ -17,6 +17,7 @@ import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.CoreTranslatorId;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.message.ArtifactTypeCacheUpdateResponse;
@@ -90,14 +91,15 @@ public class ClientArtifactTypeAccessor extends AbstractClientDataAccessor<Long,
for (Triplet<Long, String, Long> entry : response.getAttributeTypes()) {
ArtifactType key1 = cache.getByGuid(entry.getFirst());
- if (key1 == null) {
- System.out.printf("Null ArtType [%s]\n", entry.getFirst());
+ String branchGuid = entry.getSecond();
+ IOseeBranch branchToken = branchCache.getByGuid(branchGuid);
+ if (branchToken == null) {
+ branchToken = TokenFactory.createBranch(branchGuid, branchGuid);
}
- IOseeBranch key2 = branchCache.getByGuid(entry.getSecond());
- Collection<AttributeType> types = attrs.get(key1, key2);
+ Collection<AttributeType> types = attrs.get(key1, branchToken);
if (types == null) {
types = new HashSet<AttributeType>();
- attrs.put(key1, key2, types);
+ attrs.put(key1, branchToken, types);
}
types.add(attrCache.getByGuid(entry.getThird()));
}

Back to the top