Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-03-28 11:48:55 -0400
committerdonald.g.dunne2014-04-09 11:32:55 -0400
commit1f8e94e66234595711ccb229869d8ca2b4ed9489 (patch)
tree6febe577cd4f1d9a548d942e626695fd7214f6bf /plugins/org.eclipse.osee.orcs.core.test
parent568a307e7e6655ada9a1638e2cb76cb9f79699b7 (diff)
downloadorg.eclipse.osee-1f8e94e66234595711ccb229869d8ca2b4ed9489.tar.gz
org.eclipse.osee-1f8e94e66234595711ccb229869d8ca2b4ed9489.tar.xz
org.eclipse.osee-1f8e94e66234595711ccb229869d8ca2b4ed9489.zip
feature[ats_ATS19845]: Convert IOseeBranch to Identity-Long
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.core.test')
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/.project6
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactoryTest.java38
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchUtilBranchTest.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProviderTest.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/provider/MockBranchProvider.java19
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/OrcsTypesTest.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/testTypeModel.osee4
7 files changed, 60 insertions, 50 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core.test/.project b/plugins/org.eclipse.osee.orcs.core.test/.project
index 9fd31b1bc4..341ac87cb4 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/.project
+++ b/plugins/org.eclipse.osee.orcs.core.test/.project
@@ -6,6 +6,11 @@
</projects>
<buildSpec>
<buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
@@ -24,5 +29,6 @@
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactoryTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactoryTest.java
index 1af5b0ce89..b0322e9edd 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchDataFactoryTest.java
@@ -22,7 +22,7 @@ import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.model.cache.TransactionCache;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.data.CreateBranchData;
import org.junit.Before;
@@ -64,9 +64,9 @@ public class BranchDataFactoryTest {
@Test
public void testDataForTopLevelBranch() throws OseeCoreException {
String branchName = "testDataForTopLevelBranch";
- String guid = GUID.create();
+ Long branchUuid = Lib.generateUuid();
when(branch.getName()).thenReturn(branchName);
- when(branch.getGuid()).thenReturn(guid);
+ when(branch.getGuid()).thenReturn(branchUuid);
when(branchCache.getSystemRootBranch()).thenReturn(parent);
when(txCache.getHeadTransaction(parent)).thenReturn(txRecord);
@@ -77,15 +77,15 @@ public class BranchDataFactoryTest {
verify(txCache).getHeadTransaction(parent);
String comment = "Branch Creation for " + branchName;
- assertData(result, branchName, guid, BranchType.BASELINE, comment, txRecord, author, null, false);
+ assertData(result, branchName, branchUuid, BranchType.BASELINE, comment, txRecord, author, null, false);
}
@Test
public void testDataForBaselineBranch() throws OseeCoreException {
String branchName = "testDataForBaselineBranch";
- String guid = GUID.create();
+ Long branchUuid = Lib.generateUuid();
when(branch.getName()).thenReturn(branchName);
- when(branch.getGuid()).thenReturn(guid);
+ when(branch.getGuid()).thenReturn(branchUuid);
when(branchCache.get(parentToken)).thenReturn(parent);
when(txCache.getHeadTransaction(parent)).thenReturn(txRecord);
@@ -96,16 +96,17 @@ public class BranchDataFactoryTest {
verify(txCache).getHeadTransaction(parent);
String comment = "Branch Creation for " + branchName;
- assertData(result, branchName, guid, BranchType.BASELINE, comment, txRecord, author, associatedArtifact, false);
+ assertData(result, branchName, branchUuid, BranchType.BASELINE, comment, txRecord, author, associatedArtifact,
+ false);
}
@Test
public void testDataForWorkingBranch() throws OseeCoreException {
String branchName = "testDataForWorkingBranch";
String parentName = "testParentBranchName";
- String guid = GUID.create();
+ Long branchUuid = Lib.generateUuid();
when(branch.getName()).thenReturn(branchName);
- when(branch.getGuid()).thenReturn(guid);
+ when(branch.getGuid()).thenReturn(branchUuid);
when(parent.getName()).thenReturn(parentName);
@@ -118,16 +119,17 @@ public class BranchDataFactoryTest {
verify(txCache).getHeadTransaction(parent);
String comment = String.format("New Branch from %s (%s)", parentName, txRecord.getId());
- assertData(result, branchName, guid, BranchType.WORKING, comment, txRecord, author, associatedArtifact, false);
+ assertData(result, branchName, branchUuid, BranchType.WORKING, comment, txRecord, author, associatedArtifact,
+ false);
}
@Test
public void testDataForCopyTxBranch() throws OseeCoreException {
String branchName = "testDataForCopyTxBranch";
String parentName = "testParentBranchName";
- String guid = GUID.create();
+ Long branchUuid = Lib.generateUuid();
when(branch.getName()).thenReturn(branchName);
- when(branch.getGuid()).thenReturn(guid);
+ when(branch.getGuid()).thenReturn(branchUuid);
when(parent.getName()).thenReturn(parentName);
@@ -142,16 +144,16 @@ public class BranchDataFactoryTest {
verify(txRecord).getBranch();
String comment = String.format("Transaction %d copied from %s to create Branch %s", 99, parentName, branchName);
- assertData(result, branchName, guid, BranchType.WORKING, comment, txRecord, author, null, true);
+ assertData(result, branchName, branchUuid, BranchType.WORKING, comment, txRecord, author, null, true);
}
@Test
public void testDataForPortBranch() throws OseeCoreException {
String branchName = "testDataForPortBranch";
String parentName = "testParentBranchName";
- String guid = GUID.create();
+ Long branchUuid = Lib.generateUuid();
when(branch.getName()).thenReturn(branchName);
- when(branch.getGuid()).thenReturn(guid);
+ when(branch.getGuid()).thenReturn(branchUuid);
when(parent.getName()).thenReturn(parentName);
@@ -166,12 +168,12 @@ public class BranchDataFactoryTest {
verify(txRecord).getBranch();
String comment = String.format("Transaction %d ported from %s to create Branch %s", 99, parentName, branchName);
- assertData(result, branchName, guid, BranchType.PORT, comment, txRecord, author, null, true);
+ assertData(result, branchName, branchUuid, BranchType.PORT, comment, txRecord, author, null, true);
}
- private static void assertData(CreateBranchData actual, String branchName, String branchGuid, BranchType type, String comment, TransactionRecord fromTx, ArtifactReadable author, ArtifactReadable associatedArtifact, boolean isCopyFromTx) {
+ private static void assertData(CreateBranchData actual, String branchName, Long branchUuid, BranchType type, String comment, TransactionRecord fromTx, ArtifactReadable author, ArtifactReadable associatedArtifact, boolean isCopyFromTx) {
assertEquals(branchName, actual.getName());
- assertEquals(branchGuid, actual.getGuid());
+ assertEquals(branchUuid, actual.getGuid());
assertEquals(type, actual.getBranchType());
assertEquals(comment, actual.getCreationComment());
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchUtilBranchTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchUtilBranchTest.java
index 278a53a860..73f12dd9cd 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchUtilBranchTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/BranchUtilBranchTest.java
@@ -15,7 +15,7 @@ import java.util.List;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.junit.Assert;
import org.junit.Test;
@@ -24,17 +24,17 @@ import org.junit.Test;
*/
public class BranchUtilBranchTest {
- private final Branch one = new Branch(GUID.create(), "one", BranchType.WORKING, BranchState.COMMITTED, true);
- private final Branch two = new Branch(GUID.create(), "two", BranchType.WORKING, BranchState.COMMITTED, true);
- private final Branch three = new Branch(GUID.create(), "three", BranchType.WORKING, BranchState.COMMITTED, true);
- private final Branch four = new Branch(GUID.create(), "four", BranchType.WORKING, BranchState.COMMITTED, true);
- private final Branch five = new Branch(GUID.create(), "five", BranchType.WORKING, BranchState.COMMITTED, true);
- private final Branch six = new Branch(GUID.create(), "six", BranchType.WORKING, BranchState.COMMITTED, true);
- private final Branch seven = new Branch(GUID.create(), "seven", BranchType.WORKING, BranchState.COMMITTED, true);
- private final Branch eight = new Branch(GUID.create(), "eight", BranchType.WORKING, BranchState.COMMITTED, true);
- private final Branch nine = new Branch(GUID.create(), "nine", BranchType.WORKING, BranchState.COMMITTED, true);
- private final Branch ten = new Branch(GUID.create(), "ten", BranchType.WORKING, BranchState.COMMITTED, true);
- private final Branch outside = new Branch(GUID.create(), "outside", BranchType.WORKING, BranchState.COMMITTED, true);
+ private final Branch one = new Branch(Lib.generateUuid(), "one", BranchType.WORKING, BranchState.COMMITTED, true);
+ private final Branch two = new Branch(Lib.generateUuid(), "two", BranchType.WORKING, BranchState.COMMITTED, true);
+ private final Branch three = new Branch(Lib.generateUuid(), "three", BranchType.WORKING, BranchState.COMMITTED, true);
+ private final Branch four = new Branch(Lib.generateUuid(), "four", BranchType.WORKING, BranchState.COMMITTED, true);
+ private final Branch five = new Branch(Lib.generateUuid(), "five", BranchType.WORKING, BranchState.COMMITTED, true);
+ private final Branch six = new Branch(Lib.generateUuid(), "six", BranchType.WORKING, BranchState.COMMITTED, true);
+ private final Branch seven = new Branch(Lib.generateUuid(), "seven", BranchType.WORKING, BranchState.COMMITTED, true);
+ private final Branch eight = new Branch(Lib.generateUuid(), "eight", BranchType.WORKING, BranchState.COMMITTED, true);
+ private final Branch nine = new Branch(Lib.generateUuid(), "nine", BranchType.WORKING, BranchState.COMMITTED, true);
+ private final Branch ten = new Branch(Lib.generateUuid(), "ten", BranchType.WORKING, BranchState.COMMITTED, true);
+ private final Branch outside = new Branch(Lib.generateUuid(), "outside", BranchType.WORKING, BranchState.COMMITTED, true);
private void initBranchParentageList() {
two.setParentBranch(one);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProviderTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProviderTest.java
index bb320cef4c..0217ce1a2d 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProviderTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/provider/DeletedBranchProviderTest.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.orcs.core.internal.branch.provider;
import java.util.Collection;
-import org.junit.Assert;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
@@ -19,6 +18,7 @@ import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.model.mocks.MockOseeDataAccessor;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.junit.Assert;
import org.junit.Test;
/**
@@ -38,7 +38,7 @@ public final class DeletedBranchProviderTest {
@Test
public void testGetBranches() throws OseeCoreException {
- BranchCache mockCache = new BranchCache(new MockOseeDataAccessor<String, Branch>());
+ BranchCache mockCache = new BranchCache(new MockOseeDataAccessor<Long, Branch>());
Collection<Branch> branches = MockBranchProvider.createTestBranches();
mockCache.cache(branches.toArray(new Branch[branches.size()]));
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/provider/MockBranchProvider.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/provider/MockBranchProvider.java
index adb127b06b..99b99ee1cb 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/provider/MockBranchProvider.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/branch/provider/MockBranchProvider.java
@@ -16,7 +16,7 @@ import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
/**
* @author John R. Misinco
@@ -28,37 +28,38 @@ public final class MockBranchProvider implements BranchProvider {
public static Collection<Branch> createTestBranches() throws OseeCoreException {
Collection<Branch> branches = new ArrayList<Branch>();
//create a root branch
- Branch root = new Branch(GUID.create(), ROOT_BRANCH_NAME, BranchType.SYSTEM_ROOT, BranchState.COMMITTED, false);
+ Branch root =
+ new Branch(Lib.generateUuid(), ROOT_BRANCH_NAME, BranchType.SYSTEM_ROOT, BranchState.COMMITTED, false);
//add a child to root (parent)
- Branch parent = new Branch(GUID.create(), "parent", BranchType.SYSTEM_ROOT, BranchState.CREATED, false);
+ Branch parent = new Branch(Lib.generateUuid(), "parent", BranchType.SYSTEM_ROOT, BranchState.CREATED, false);
parent.setParentBranch(root);
//add children branches to parent
- Branch child1 = new Branch(GUID.create(), "child1", BranchType.SYSTEM_ROOT, BranchState.MODIFIED, false);
+ Branch child1 = new Branch(Lib.generateUuid(), "child1", BranchType.SYSTEM_ROOT, BranchState.MODIFIED, false);
child1.setParentBranch(parent);
child1.setArchived(true);
child1.setBranchState(BranchState.DELETED);
//this branch should get deleted
- Branch child2 = new Branch(GUID.create(), "child2", BranchType.WORKING, BranchState.DELETED, true);
+ Branch child2 = new Branch(Lib.generateUuid(), "child2", BranchType.WORKING, BranchState.DELETED, true);
child2.setParentBranch(parent);
- Branch child3 = new Branch(GUID.create(), "child3", BranchType.SYSTEM_ROOT, BranchState.CREATED, false);
+ Branch child3 = new Branch(Lib.generateUuid(), "child3", BranchType.SYSTEM_ROOT, BranchState.CREATED, false);
//make one a merge branch
child3.setBranchType(BranchType.MERGE);
child3.setParentBranch(parent);
- Branch grandChild1 = new Branch(GUID.create(), "grandChild1", BranchType.MERGE, BranchState.DELETED, false);
+ Branch grandChild1 = new Branch(Lib.generateUuid(), "grandChild1", BranchType.MERGE, BranchState.DELETED, false);
grandChild1.setArchived(true);
grandChild1.setParentBranch(child1);
Branch grandChild2 =
- new Branch(GUID.create(), "grandChild2", BranchType.SYSTEM_ROOT, BranchState.MODIFIED, false);
+ new Branch(Lib.generateUuid(), "grandChild2", BranchType.SYSTEM_ROOT, BranchState.MODIFIED, false);
grandChild2.setParentBranch(child1);
//this branch should get deleted
- Branch grandChild3 = new Branch(GUID.create(), "grandChild3", BranchType.WORKING, BranchState.DELETED, true);
+ Branch grandChild3 = new Branch(Lib.generateUuid(), "grandChild3", BranchType.WORKING, BranchState.DELETED, true);
grandChild3.setParentBranch(child2);
//add branches in a random order
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/OrcsTypesTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/OrcsTypesTest.java
index a6f57803b7..a263c07654 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/OrcsTypesTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/OrcsTypesTest.java
@@ -36,7 +36,6 @@ import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.jdk.core.type.Identity;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.resource.management.IResource;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
@@ -91,11 +90,13 @@ public class OrcsTypesTest {
private static final IRelationType REQUIREMENT_REL = TokenFactory.createRelationType(0x2000000000000157L, "Requirement Relation");
private static final IRelationType ANOTHER_REL = TokenFactory.createRelationType(0x2000000000000158L, "Another Relation");
- private static final IOseeBranch BRANCH_A = TokenFactory.createBranch("AU2FErW1QwSXWPiP4cwA", "Branch A");
- private static final IOseeBranch BRANCH_B = TokenFactory.createBranch("AU2JKsKQAQAvzkTkk+gA", "Branch B");
- private static final IOseeBranch BRANCH_C = TokenFactory.createBranch( "Branch C");
- private static final IOseeBranch BRANCH_D = TokenFactory.createBranch( "Branch D");
- private static final IOseeBranch BRANCH_E = TokenFactory.createBranch( "Branch E");
+ static long BRANCH_A_UUID = 3458234234L;
+ static long BRANCH_B_UUID = 9993245332L;
+ private static final IOseeBranch BRANCH_A = TokenFactory.createBranch(BRANCH_A_UUID, "Branch A");
+ private static final IOseeBranch BRANCH_B = TokenFactory.createBranch(BRANCH_B_UUID, "Branch B");
+ private static final IOseeBranch BRANCH_C = TokenFactory.createBranch("Branch C");
+ private static final IOseeBranch BRANCH_D = TokenFactory.createBranch("Branch D");
+ private static final IOseeBranch BRANCH_E = TokenFactory.createBranch("Branch E");
@Mock private Log logger;
@Mock private OrcsTypesDataStore dataStore;
@@ -412,7 +413,7 @@ public class OrcsTypesTest {
String overrideArtTypes =
"\n overrides artifactType \"Artifact\" {\n" +
" inheritAll \n" +
- " update attribute \"Annotation\" branchGuid \"AU2FErW1QwSXWPiP4cwA\"\n" +
+ " update attribute \"Annotation\" branchUuid "+BRANCH_A_UUID+"\n" +
"}\n" +
"\n overrides artifactType \"Other Artifact\" {\n" +
" inheritAll \n" +
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/testTypeModel.osee b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/testTypeModel.osee
index 4ef968c528..18165813da 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/testTypeModel.osee
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/testTypeModel.osee
@@ -129,11 +129,11 @@ artifactType "Other Artifact" extends "Artifact" {
artifactType "SubSystem Requirement" extends "Requirement" , "Other Artifact" {
guid "BOnBhJ1XAFGKcrku3LgA"
uuid 0x000000000000001D
- attribute "Field 1" branchGuid "AU2FErW1QwSXWPiP4cwA"
+ attribute "Field 1" branchUuid 3458234234
}
abstract artifactType "Last Artifact" extends "SubSystem Requirement" {
guid "AUqqRktDXW9r6YXq0WQA"
uuid 0x0000000000000021
- attribute "Field 2" branchGuid "AU2JKsKQAQAvzkTkk+gA"
+ attribute "Field 2" branchUuid 9993245332
}

Back to the top