Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2015-07-28 19:36:47 -0400
committerAngel Avila2015-09-11 20:56:28 -0400
commita3e50a6575dd043c3b2c3565cab59c831a3839d0 (patch)
treee4e382d520c4503b3ec8457ea0e6a43862f6da31 /plugins/org.eclipse.osee.ats.core.test
parentd5289b1af5fe97ca45b95e329a1a89fc64b29adf (diff)
downloadorg.eclipse.osee-a3e50a6575dd043c3b2c3565cab59c831a3839d0.tar.gz
org.eclipse.osee-a3e50a6575dd043c3b2c3565cab59c831a3839d0.tar.xz
org.eclipse.osee-a3e50a6575dd043c3b2c3565cab59c831a3839d0.zip
feature[ats_ATS186279]: Performance Rpt - Create Backlog Column
Diffstat (limited to 'plugins/org.eclipse.osee.ats.core.test')
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/AtsCore_Column_JT_Suite.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/BacklogColumnTest.java76
2 files changed, 77 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/AtsCore_Column_JT_Suite.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/AtsCore_Column_JT_Suite.java
index 8ffcff553a6..6cf84093ef5 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/AtsCore_Column_JT_Suite.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/AtsCore_Column_JT_Suite.java
@@ -21,6 +21,7 @@ import org.junit.runners.Suite;
@Suite.SuiteClasses({
ActionableItemsColumnTest.class,
AssigneeColumnTest.class,
+ BacklogColumnTest.class,
CountryColumnTest.class,
ImplementersColumnTest.class,
InsertionColumnTest.class,
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/BacklogColumnTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/BacklogColumnTest.java
new file mode 100644
index 00000000000..a8f11dea8d8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/column/BacklogColumnTest.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2015 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.column;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.when;
+import java.util.Arrays;
+import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.workdef.IRelationResolver;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+/**
+ * Test case for {@link BacklogColumn}
+ *
+ * @author Donald G. Dunne
+ */
+public class BacklogColumnTest extends ProgramColumn {
+
+ // @formatter:off
+ @Mock private IAtsWorkItem workItem;
+ @Mock private IAtsWorkItem goal, backlog;
+ @Mock private IAtsObject object;
+ @Mock private IRelationResolver relResolver;
+ // @formatter:on
+
+ @Before
+ public void setup() throws OseeCoreException {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ @Test
+ public void test() {
+ String str = BacklogColumn.getColumnText(object, relResolver);
+ assertEquals(str, "");
+
+ when(relResolver.getRelated(workItem, AtsRelationTypes.Goal_Goal, IAtsWorkItem.class)).thenReturn(
+ Arrays.asList());
+ str = BacklogColumn.getColumnText(workItem, relResolver);
+ assertEquals(str, "");
+
+ when(relResolver.getRelated(workItem, AtsRelationTypes.Goal_Goal, IAtsWorkItem.class)).thenReturn(
+ Arrays.asList(goal));
+ when(relResolver.getRelatedCount(goal, AtsRelationTypes.AgileTeamToBacklog_AgileTeam)).thenReturn(0);
+ when(goal.getName()).thenReturn("My Goal");
+ str = BacklogColumn.getColumnText(workItem, relResolver);
+ assertEquals("My Goal", str);
+
+ when(relResolver.getRelated(workItem, AtsRelationTypes.Goal_Goal, IAtsWorkItem.class)).thenReturn(
+ Arrays.asList(backlog));
+ when(relResolver.getRelatedCount(backlog, AtsRelationTypes.AgileTeamToBacklog_AgileTeam)).thenReturn(1);
+ when(backlog.getName()).thenReturn("My Backlog");
+ str = BacklogColumn.getColumnText(workItem, relResolver);
+ assertEquals("My Backlog (BL)", str);
+
+ when(relResolver.getRelated(workItem, AtsRelationTypes.Goal_Goal, IAtsWorkItem.class)).thenReturn(
+ Arrays.asList(backlog, goal));
+ when(relResolver.getRelatedCount(backlog, AtsRelationTypes.AgileTeamToBacklog_AgileTeam)).thenReturn(1);
+ str = BacklogColumn.getColumnText(workItem, relResolver);
+ assertEquals("My Backlog (BL); My Goal", str);
+
+ }
+}

Back to the top