Skip to main content
summaryrefslogtreecommitdiffstats
blob: 39b7c2879856215ac7336b70e562d2957e912eda (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*******************************************************************************
 * 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.ats.client.integration.tests.ats.column;

import java.util.Collection;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.client.demo.DemoWorkType;
import org.eclipse.osee.ats.client.integration.tests.util.DemoTestUtil;
import org.eclipse.osee.ats.column.ActionableItemsColumn;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.support.test.util.TestUtil;
import org.junit.Assert;

/**
 * @tests ActionableItemsColumn
 * @author Donald G. Dunne
 */
public class ActionableItemsColumnTest {

   @org.junit.Test
   public void testGetActionableItems() throws Exception {
      SevereLoggingMonitor loggingMonitor = TestUtil.severeLoggingStart();

      TeamWorkFlowArtifact codeArt =
         (TeamWorkFlowArtifact) DemoTestUtil.getUncommittedActionWorkflow(DemoWorkType.Code);
      Collection<IAtsActionableItem> aias = ActionableItemsColumn.getActionableItems(codeArt);
      Assert.assertEquals(1, aias.size());
      Assert.assertEquals("SAW Code", aias.iterator().next().getName());

      Artifact actionArt = codeArt.getParentActionArtifact();
      aias = ActionableItemsColumn.getActionableItems(actionArt);
      Assert.assertEquals(4, aias.size());

      TestUtil.severeLoggingEnd(loggingMonitor);
   }

   @org.junit.Test
   public void testGetActionableItemsStr() throws Exception {
      SevereLoggingMonitor loggingMonitor = TestUtil.severeLoggingStart();

      TeamWorkFlowArtifact codeArt =
         (TeamWorkFlowArtifact) DemoTestUtil.getUncommittedActionWorkflow(DemoWorkType.Code);
      Assert.assertEquals("SAW Code", ActionableItemsColumn.getActionableItemsStr(codeArt));

      Artifact actionArt = codeArt.getParentActionArtifact();

      String results = ActionableItemsColumn.getActionableItemsStr(actionArt);
      Assert.assertTrue(results.contains("SAW Code"));
      Assert.assertTrue(results.contains("SAW SW Design"));
      Assert.assertTrue(results.contains("SAW Test"));
      Assert.assertTrue(results.contains("SAW Requirements"));
      Assert.assertEquals(4, results.split(", ").length);

      TestUtil.severeLoggingEnd(loggingMonitor);
   }

}

Back to the top