Skip to main content
summaryrefslogblamecommitdiffstats
blob: 39b7c2879856215ac7336b70e562d2957e912eda (plain) (tree)
1
2
3
4
5
6
7
8
9
10





                                                                                
  


                                                                                 
                                                                 

                            
                                                      


                                                                       
                                                                  
                                                               
                                                                
                                                   
                        


                               
                          




                                                          

                                                                          

                                                                                             
                                                                                              


                                                                        
                                                             


                                                                 
                                                



                                                             

                                                                          

                                                                                             

                                                                                            
                                                             






                                                                              

                                                


    
/*******************************************************************************
 * 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