summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2012-01-23 14:05:00 (EST)
committer Ryan D. Brooks2012-01-23 14:05:00 (EST)
commite4b16e7bc3885cf5fc38fb13cb6a58ff6bad1e81 (patch)
tree65f9b9d2ef4fb96e44edbe679085fb12bb551c33
parent19bbf005ca3c90b37d25b1436fee88f56d69318e (diff)
downloadorg.eclipse.osee-e4b16e7bc3885cf5fc38fb13cb6a58ff6bad1e81.zip
org.eclipse.osee-e4b16e7bc3885cf5fc38fb13cb6a58ff6bad1e81.tar.gz
org.eclipse.osee-e4b16e7bc3885cf5fc38fb13cb6a58ff6bad1e81.tar.bz2
bug[ats_A2QNG]: Update ATS to show all committed into branches regardless of parallel configuration
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCoreTest.java106
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCore.java57
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/CommitXManager.java48
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitLabelProvider.java74
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java8
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/suite/MasterTestSuite_DemoCoreTests.java3
7 files changed, 255 insertions, 44 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCoreTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCoreTest.java
new file mode 100644
index 0000000..06bc444
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCoreTest.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.ats.core.branch;
+
+import static org.junit.Assert.assertTrue;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import org.eclipse.osee.ats.core.AtsTestUtil;
+import org.eclipse.osee.ats.core.commit.ICommitConfigArtifact;
+import org.eclipse.osee.ats.core.config.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.type.AtsAttributeTypes;
+import org.eclipse.osee.ats.core.type.AtsRelationTypes;
+import org.eclipse.osee.ats.core.version.VersionArtifact;
+import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
+import org.eclipse.osee.framework.core.model.cache.BranchCache;
+import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.support.test.util.DemoSawBuilds;
+import org.eclipse.osee.support.test.util.TestUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test unit for {@AtsBranchManagerCore}
+ *
+ * @author Shawn F. Cook
+ */
+public class AtsBranchManagerCoreTest {
+ private final Date todaysDate = new Date();
+ private static User user = null;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ user = UserManager.getUser();
+ OseeProperties.setIsInTest(true);
+ TestUtil.setIsInTest(true);
+ AtsTestUtil.cleanupAndReset("AtsBranchManagerCoreTest");
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ AtsTestUtil.cleanup();
+ OseeProperties.setIsInTest(false);
+ TestUtil.setIsInTest(false);
+ }
+
+ @Test
+ public void testGetCommitTransactionsAndConfigItemsForTeamWf() throws OseeCoreException, InterruptedException {
+ TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
+
+ //Test Version-based Team Arts
+ VersionArtifact verArt1 = AtsTestUtil.getVerArt1();
+ VersionArtifact verArt2 = AtsTestUtil.getVerArt2();
+ verArt1.addRelation(AtsRelationTypes.ParallelVersion_Child, verArt2);
+ teamArt.addRelation(AtsRelationTypes.TeamWorkflowTargetedForVersion_Version, verArt1);
+ Collection<Object> commitObjs = AtsBranchManagerCore.getCommitTransactionsAndConfigItemsForTeamWf(teamArt);
+ assertTrue("commitObjs has wrong size", commitObjs.size() == 2);
+ assertTrue("commitObjs is missing verArt1", commitObjs.contains(verArt1));
+ assertTrue("commitObjs is missing verArt2", commitObjs.contains(verArt2));
+
+ //Test Team Def-base Team Arts
+ TeamDefinitionArtifact teamDef = teamArt.getTeamDefinition();
+ teamDef.setSoleAttributeValue(AtsAttributeTypes.TeamUsesVersions, false);
+ teamDef.setSoleAttributeValue(AtsAttributeTypes.BaselineBranchGuid, DemoSawBuilds.SAW_Bld_1.getGuid());
+ commitObjs = AtsBranchManagerCore.getCommitTransactionsAndConfigItemsForTeamWf(teamArt);
+ assertTrue("commitObjs has wrong size", commitObjs.size() == 1);
+ assertTrue("commitObjs is missing teamDef", commitObjs.contains(teamDef));
+
+ //Test TxRecords
+ Branch branch = BranchManager.getBranch(DemoSawBuilds.SAW_Bld_1);
+ TransactionRecord txRecord =
+ new TransactionRecord(1234, branch.getId(), "comment", new Date(), UserManager.getUser().getArtId(),
+ UserManager.getUser().getArtId(), TransactionDetailsType.Baselined);
+ BranchCache branchCache = BranchManager.getCache();
+ txRecord.setBranchCache(branchCache);
+ Collection<TransactionRecord> commitTxs = new ArrayList<TransactionRecord>();
+ Collection<ICommitConfigArtifact> configArtSet = new HashSet<ICommitConfigArtifact>();
+ commitTxs.add(txRecord);
+ commitObjs = AtsBranchManagerCore.combineCommitTransactionsAndConfigItems(configArtSet, commitTxs);
+ assertTrue("commitObjs has wrong size", commitObjs.size() == 1);
+
+ Collection<ICommitConfigArtifact> configArtifactsConfiguredToCommitTo =
+ AtsBranchManagerCore.getConfigArtifactsConfiguredToCommitTo(teamArt);
+ configArtSet.add(configArtifactsConfiguredToCommitTo.iterator().next());
+ commitObjs = AtsBranchManagerCore.combineCommitTransactionsAndConfigItems(configArtSet, commitTxs);
+ assertTrue("commitObjs has wrong size", commitObjs.size() == 1);
+ assertTrue("commitObjs has wrong object", commitObjs.contains(teamDef));
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCore.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCore.java
index 072a648..3cd3603 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCore.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/branch/AtsBranchManagerCore.java
@@ -150,8 +150,7 @@ public class AtsBranchManagerCore {
return !conflictManager.remainingConflictsExist();
}
- public static TransactionRecord getCommitTransactionRecord(TeamWorkFlowArtifact teamArt, ICommitConfigArtifact configArt) throws OseeCoreException {
- Branch branch = configArt.getParentBranch();
+ public static TransactionRecord getCommitTransactionRecord(TeamWorkFlowArtifact teamArt, Branch branch) throws OseeCoreException {
if (branch == null) {
return null;
}
@@ -165,6 +164,11 @@ public class AtsBranchManagerCore {
return null;
}
+ public static TransactionRecord getCommitTransactionRecord(TeamWorkFlowArtifact teamArt, ICommitConfigArtifact configArt) throws OseeCoreException {
+ Branch branch = configArt.getParentBranch();
+ return getCommitTransactionRecord(teamArt, branch);
+ }
+
public static CommitStatus getCommitStatus(TeamWorkFlowArtifact teamArt, ICommitConfigArtifact configArt) throws OseeCoreException {
Branch destinationBranch = configArt.getParentBranch();
return getCommitStatus(teamArt, destinationBranch);
@@ -442,6 +446,55 @@ public class AtsBranchManagerCore {
return branch.getId();
}
+ /**
+ * @return Logically combines the results from getConfigArtifactsConfiguredToCommitTo() and
+ * getCommitTransactionsToUnarchivedBaslineBranchs() into a single Collection of Objects. Objects are selected from
+ * getConfigArtifactsConfiguredToCommitTo() first. Then compared to the branches in the Collection of TxRecords from
+ * getCommitTransactionsToUnarchivedBaslineBranchs(). The TxRecords take LESS priority than the ICommitConfigArts
+ * from getConfigArtifactsConfiguredToCommitTo()
+ */
+ public static Collection<Object> getCommitTransactionsAndConfigItemsForTeamWf(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
+ Collection<ICommitConfigArtifact> configArtSet = getConfigArtifactsConfiguredToCommitTo(teamArt);
+ Collection<TransactionRecord> commitTxs = getCommitTransactionsToUnarchivedBaslineBranchs(teamArt);
+ Collection<Object> commitMgrInputObjs = combineCommitTransactionsAndConfigItems(configArtSet, commitTxs);
+ return commitMgrInputObjs;
+ }
+
+ /**
+ * This method was refactored from above so it could be tested independently
+ *
+ * @param configArtSet
+ * @param commitTxs
+ * @return
+ * @throws OseeCoreException
+ */
+ public static Collection<Object> combineCommitTransactionsAndConfigItems(Collection<ICommitConfigArtifact> configArtSet, Collection<TransactionRecord> commitTxs) throws OseeCoreException {
+ // commitMgrInputObjs will hold a union of all commits from configArtSet and commitTxs.
+ // - first, we addAll configArtSet
+ // - next, we loop through commitTxs and for any tx that has the same branch as ANY pre-existing commit
+ // in configArtSet we do NOT add it to commitMgrInputObjs.
+ Collection<Object> commitMgrInputObjs = new HashSet<Object>();
+ commitMgrInputObjs.addAll(configArtSet);
+ //for each tx commit...
+ for (TransactionRecord txRecord : commitTxs) {
+ Branch txBranch = txRecord.getBranch();
+ boolean isCommitAlreadyPresent = false;
+ // ... compare the branch of the tx commit to all the parent branches in configArtSet and do NOT add the tx
+ // commit if it is already represented.
+ for (ICommitConfigArtifact configArt : configArtSet) {
+ Branch configArtBranch = configArt.getParentBranch();
+ if (txBranch == configArtBranch) {
+ isCommitAlreadyPresent = true;
+ break;
+ }
+ }
+ if (!isCommitAlreadyPresent) {
+ commitMgrInputObjs.add(txRecord);
+ }
+ }
+ return commitMgrInputObjs;
+ }
+
private static Collection<TransactionRecord> getCommitTransactionsToUnarchivedBaslineBranchs(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
Collection<TransactionRecord> committedTransactions =
TransactionManager.getCommittedArtifactTransactionIds(teamArt);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/CommitXManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/CommitXManager.java
index 239b436..9636131 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/CommitXManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/CommitXManager.java
@@ -21,8 +21,10 @@ import org.eclipse.osee.ats.core.branch.CommitStatus;
import org.eclipse.osee.ats.core.commit.ICommitConfigArtifact;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.util.AtsBranchManager;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
@@ -57,12 +59,12 @@ public class CommitXManager extends XViewer {
getLabelProvider().dispose();
}
- public List<ICommitConfigArtifact> getSelectedConfigArtifacts() {
- List<ICommitConfigArtifact> arts = new ArrayList<ICommitConfigArtifact>();
+ public List<Object> getSelectedArtifacts() {
+ List<Object> arts = new ArrayList<Object>();
TreeItem items[] = getTree().getSelection();
if (items.length > 0) {
for (TreeItem item : items) {
- arts.add((ICommitConfigArtifact) item.getData());
+ arts.add(item.getData());
}
}
return arts;
@@ -78,9 +80,22 @@ public class CommitXManager extends XViewer {
@Override
public void handleDoubleClick() {
try {
- ICommitConfigArtifact configArt = getSelectedConfigArtifacts().iterator().next();
- Branch destBranch = configArt.getParentBranch();
- CommitStatus commitStatus = AtsBranchManagerCore.getCommitStatus(xCommitManager.getTeamArt(), configArt);
+ Object firstSelectedArt = getSelectedArtifacts().iterator().next();
+ Branch branch = null;
+ String displayName = "";
+ if (firstSelectedArt instanceof ICommitConfigArtifact) {
+ ICommitConfigArtifact configArt = (ICommitConfigArtifact) firstSelectedArt;
+ branch = configArt.getParentBranch();
+ displayName = configArt.toString();
+ } else if (firstSelectedArt instanceof TransactionRecord) {
+ TransactionRecord txRecord = (TransactionRecord) firstSelectedArt;
+ branch = txRecord.getBranch();
+ displayName = txRecord.toString();
+ } else {
+ throw new OseeArgumentException("Unhandled element type [%s]", firstSelectedArt.getClass().toString());
+ }
+
+ CommitStatus commitStatus = AtsBranchManagerCore.getCommitStatus(xCommitManager.getTeamArt(), branch);
if (commitStatus == CommitStatus.Working_Branch_Not_Created) {
AWorkbench.popup(commitStatus.getDisplayName(), "Need to create a working branch");
} else if (commitStatus == CommitStatus.No_Commit_Needed) {
@@ -88,22 +103,19 @@ public class CommitXManager extends XViewer {
"Destination Branch creation date is after commit to Parent Destination Branch; No Action Needed");
} else if (commitStatus == CommitStatus.Branch_Not_Configured) {
AWorkbench.popup(commitStatus.getDisplayName(),
- "Talk to project lead to configure branch for version [" + configArt + "]");
+ "Talk to project lead to configure branch for version [" + displayName + "]");
} else if (commitStatus == CommitStatus.Branch_Commit_Disabled) {
AWorkbench.popup(commitStatus.getDisplayName(),
- "Talk to project lead as to why commit disabled for version [" + configArt + "]");
+ "Talk to project lead as to why commit disabled for version [" + displayName + "]");
} else if (commitStatus == CommitStatus.Commit_Needed) {
- destBranch = configArt.getParentBranch();
- AtsBranchManager.commitWorkingBranch(xCommitManager.getTeamArt(), true, false, destBranch,
- AtsBranchManagerCore.isBranchesAllCommittedExcept(xCommitManager.getTeamArt(), destBranch));
+ AtsBranchManager.commitWorkingBranch(xCommitManager.getTeamArt(), true, false, branch,
+ AtsBranchManagerCore.isBranchesAllCommittedExcept(xCommitManager.getTeamArt(), branch));
} else if (commitStatus == CommitStatus.Merge_In_Progress) {
- destBranch = configArt.getParentBranch();
- AtsBranchManager.commitWorkingBranch(xCommitManager.getTeamArt(), true, false, destBranch,
- AtsBranchManagerCore.isBranchesAllCommittedExcept(xCommitManager.getTeamArt(), destBranch));
+ AtsBranchManager.commitWorkingBranch(xCommitManager.getTeamArt(), true, false, branch,
+ AtsBranchManagerCore.isBranchesAllCommittedExcept(xCommitManager.getTeamArt(), branch));
} else if (commitStatus == CommitStatus.Committed) {
- AtsBranchManager.showChangeReportForBranch(xCommitManager.getTeamArt(), destBranch);
+ AtsBranchManager.showChangeReportForBranch(xCommitManager.getTeamArt(), branch);
} else if (commitStatus == CommitStatus.Committed_With_Merge) {
- destBranch = configArt.getParentBranch();
MessageDialog dialog =
new MessageDialog(Displays.getActiveShell(), "Select Report", null,
"Both Change Report and Merge Manager exist.\n\nSelect to open.", MessageDialog.QUESTION,
@@ -114,11 +126,11 @@ public class CommitXManager extends XViewer {
}
// change report
if (result == 0) {
- AtsBranchManager.showChangeReportForBranch(xCommitManager.getTeamArt(), destBranch);
+ AtsBranchManager.showChangeReportForBranch(xCommitManager.getTeamArt(), branch);
}
// merge manager
else {
- AtsBranchManager.showMergeManager(xCommitManager.getTeamArt(), destBranch);
+ AtsBranchManager.showMergeManager(xCommitManager.getTeamArt(), branch);
}
}
} catch (OseeCoreException ex) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitLabelProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitLabelProvider.java
index 9ab9f18..57b2cd2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitLabelProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitLabelProvider.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.ats.core.commit.ICommitConfigArtifact;
import org.eclipse.osee.ats.core.config.TeamDefinitionArtifact;
import org.eclipse.osee.ats.core.version.VersionArtifact;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.TransactionRecord;
@@ -41,8 +42,17 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
@Override
public Image getColumnImage(Object element, XViewerColumn xCol, int columnIndex) throws OseeCoreException {
- ICommitConfigArtifact configArt = (ICommitConfigArtifact) element;
- Branch branch = configArt.getParentBranch();
+ Branch branch = null;
+ if (element instanceof ICommitConfigArtifact) {
+ ICommitConfigArtifact configArt = (ICommitConfigArtifact) element;
+ branch = configArt.getParentBranch();
+ } else if (element instanceof TransactionRecord) {
+ TransactionRecord txRecord = (TransactionRecord) element;
+ branch = txRecord.getBranch();
+ } else {
+ throw new OseeArgumentException("Unhandled element type [%s]", element.getClass().toString());
+ }
+
if (xCol.equals(CommitXManagerFactory.Action_Col)) {
return ImageManager.getImage(FrameworkImage.ARROW_RIGHT_YELLOW);
}
@@ -52,7 +62,7 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
if (xCol.equals(CommitXManagerFactory.Status_Col)) {
try {
CommitStatus commitStatus =
- AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), configArt);
+ AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), branch);
if (commitStatus == CommitStatus.Branch_Not_Configured || commitStatus == CommitStatus.Branch_Commit_Disabled ||
//
commitStatus == CommitStatus.Commit_Needed || commitStatus == CommitStatus.Working_Branch_Not_Created) {
@@ -73,7 +83,7 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
} else if (xCol.equals(CommitXManagerFactory.Merge_Col)) {
try {
CommitStatus commitStatus =
- AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), configArt);
+ AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), branch);
if (commitStatus == CommitStatus.Merge_In_Progress || commitStatus == CommitStatus.Committed_With_Merge) {
return ImageManager.getImage(FrameworkImage.OUTGOING_MERGED);
}
@@ -87,34 +97,58 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
@Override
public String getColumnText(Object element, XViewerColumn xCol, int columnIndex) throws OseeCoreException {
- ICommitConfigArtifact configArt = (ICommitConfigArtifact) element;
- Branch branch = configArt.getParentBranch();
+ Branch branch = null;
+ if (element instanceof ICommitConfigArtifact) {
+ ICommitConfigArtifact configArt = (ICommitConfigArtifact) element;
+ branch = configArt.getParentBranch();
+ } else if (element instanceof TransactionRecord) {
+ TransactionRecord txRecord = (TransactionRecord) element;
+ branch = txRecord.getBranch();
+ } else {
+ throw new OseeArgumentException("Unhandled element type [%s]", element.getClass().toString());
+ }
if (xCol.equals(CommitXManagerFactory.Status_Col)) {
- return AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), configArt).getDisplayName();
+ return AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), branch).getDisplayName();
} else if (xCol.equals(CommitXManagerFactory.Merge_Col)) {
return "";
} else if (xCol.equals(CommitXManagerFactory.Version_Col)) {
- return ((Artifact) element).getName();
+ return handleVersionColumn(element);
} else if (xCol.equals(CommitXManagerFactory.Configuring_Object_Col)) {
- return ((Artifact) element).getArtifactTypeName();
+ return handleArtifactTypeNameColumn(element);
} else if (xCol.equals(CommitXManagerFactory.Commit_Date)) {
- return handleCommitDateColumn(configArt);
+ return handleCommitDateColumn(branch);
} else if (xCol.equals(CommitXManagerFactory.Commit_Comment)) {
- return handleCommitCommentColumn(configArt);
+ return handleCommitCommentColumn(branch);
} else if (xCol.equals(CommitXManagerFactory.Dest_Branch_Col)) {
return handleDestBranchColumn(element, branch);
} else if (xCol.equals(CommitXManagerFactory.Dest_Branch_Create_Date_Col)) {
return handleDestBranchCreationDateColumn(element, branch);
} else if (xCol.equals(CommitXManagerFactory.Action_Col)) {
- return handleActionColumn(configArt);
+ return handleActionColumn(branch);
}
return "unhandled column";
}
- private String handleCommitDateColumn(ICommitConfigArtifact configArt) throws OseeCoreException {
+ private String handleVersionColumn(Object element) {
+ if (element instanceof ICommitConfigArtifact) {
+ return ((Artifact) element).getName();
+ } else {
+ return "";
+ }
+ }
+
+ private String handleArtifactTypeNameColumn(Object element) {
+ if (element instanceof ICommitConfigArtifact) {
+ return ((Artifact) element).getArtifactTypeName();
+ } else {
+ return "";
+ }
+ }
+
+ private String handleCommitDateColumn(Branch branch) throws OseeCoreException {
TransactionRecord transactionRecord =
- AtsBranchManagerCore.getCommitTransactionRecord(commitXManager.getXCommitViewer().getTeamArt(), configArt);
+ AtsBranchManagerCore.getCommitTransactionRecord(commitXManager.getXCommitViewer().getTeamArt(), branch);
if (transactionRecord != null) {
new DateUtil();
return DateUtil.getMMDDYYHHMM(transactionRecord.getTimeStamp());
@@ -122,9 +156,9 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
return "Not Committed";
}
- private String handleCommitCommentColumn(ICommitConfigArtifact configArt) throws OseeCoreException {
+ private String handleCommitCommentColumn(Branch branch) throws OseeCoreException {
TransactionRecord transactionRecord =
- AtsBranchManagerCore.getCommitTransactionRecord(commitXManager.getXCommitViewer().getTeamArt(), configArt);
+ AtsBranchManagerCore.getCommitTransactionRecord(commitXManager.getXCommitViewer().getTeamArt(), branch);
if (transactionRecord != null) {
return transactionRecord.getComment();
}
@@ -136,6 +170,8 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
return branch == null ? "Parent Branch Not Configured for Version [" + element + "]" : branch.getShortName();
} else if (element instanceof TeamDefinitionArtifact) {
return branch == null ? "Parent Branch Not Configured for Team Definition [" + element + "]" : branch.getShortName();
+ } else if (element instanceof TransactionRecord) {
+ return branch.getShortName();
}
return "";
}
@@ -145,13 +181,15 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
return branch == null ? "Parent Branch Not Configured for Version [" + element + "]" : DateUtil.getMMDDYYHHMM(branch.getBaseTransaction().getTimeStamp());
} else if (element instanceof TeamDefinitionArtifact) {
return branch == null ? "Parent Branch Not Configured for Team Definition [" + element + "]" : DateUtil.getMMDDYYHHMM(branch.getBaseTransaction().getTimeStamp());
+ } else if (element instanceof TransactionRecord) {
+ return DateUtil.getMMDDYYHHMM(branch.getBaseTransaction().getTimeStamp());
}
return "";
}
- private String handleActionColumn(ICommitConfigArtifact configArt) throws OseeCoreException {
+ private String handleActionColumn(Branch branch) throws OseeCoreException {
CommitStatus commitStatus =
- AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), configArt);
+ AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), branch);
if (commitStatus == CommitStatus.Branch_Not_Configured) {
return "Configure Branch";
} else if (commitStatus == CommitStatus.Branch_Commit_Disabled) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
index 98c0e78..f2ceb7e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
@@ -25,7 +25,6 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.ats.core.branch.AtsBranchManagerCore;
-import org.eclipse.osee.ats.core.commit.ICommitConfigArtifact;
import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.team.TeamWorkFlowManager;
import org.eclipse.osee.ats.core.type.AtsArtifactTypes;
@@ -254,12 +253,13 @@ public class XCommitManager extends GenericXWidget implements IArtifactWidget, I
}
+ @SuppressWarnings("unused")
public void loadTable() {
try {
if (xCommitManager != null && teamArt != null && xCommitManager.getContentProvider() != null) {
- Collection<ICommitConfigArtifact> configArtSet =
- AtsBranchManagerCore.getConfigArtifactsConfiguredToCommitTo(teamArt);
- xCommitManager.setInput(configArtSet);
+ Collection<Object> commitMgrInputObjs =
+ AtsBranchManagerCore.getCommitTransactionsAndConfigItemsForTeamWf(teamArt);
+ xCommitManager.setInput(commitMgrInputObjs);
xCommitManager.refresh();
refresh();
}
diff --git a/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF
index da1c8c5..15c0c94 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF
@@ -11,6 +11,7 @@ Import-Package: org.eclipse.core.runtime,
org.eclipse.osee.ats.config.demo,
org.eclipse.osee.ats.config.demo.config,
org.eclipse.osee.ats.core,
+ org.eclipse.osee.ats.core.branch,
org.eclipse.osee.coverage,
org.eclipse.osee.coverage.import01,
org.eclipse.osee.coverage.import02,
@@ -27,9 +28,9 @@ Import-Package: org.eclipse.core.runtime,
org.eclipse.osee.define,
org.eclipse.osee.framework.access.test,
org.eclipse.osee.framework.core.client,
+ org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.message.test,
- org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.model,
org.eclipse.osee.framework.core.test,
org.eclipse.osee.framework.database.core,
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/suite/MasterTestSuite_DemoCoreTests.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/suite/MasterTestSuite_DemoCoreTests.java
index 812b331..f9c5370 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/suite/MasterTestSuite_DemoCoreTests.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/suite/MasterTestSuite_DemoCoreTests.java
@@ -14,6 +14,7 @@ import static org.junit.Assert.assertTrue;
import org.eclipse.osee.ats.config.demo.config.DemoDbUtil;
import org.eclipse.osee.ats.core.AtsCore_JT_Suite;
import org.eclipse.osee.ats.core.AtsCore_PT_Suite;
+import org.eclipse.osee.ats.core.branch.AtsBranchManagerCoreTest;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
import org.eclipse.osee.framework.core.client.OseeClientSession;
import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
@@ -28,7 +29,7 @@ import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
-@Suite.SuiteClasses({AtsCore_JT_Suite.class, AtsCore_PT_Suite.class})
+@Suite.SuiteClasses({AtsCore_JT_Suite.class, AtsCore_PT_Suite.class, AtsBranchManagerCoreTest.class})
/**
* Core tests that are necessary before populate demo database is run
* @author Donald G. Dunne