Skip to main content
summaryrefslogtreecommitdiffstats
blob: 81a9502bf6a4c951349390ef3d306d218830416a (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
/*******************************************************************************
 * Copyright (c) 2013 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.core.client.operation;

import java.util.Arrays;
import org.junit.Assert;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
import org.eclipse.osee.ats.core.client.operation.MoveTeamWorkflowsOperation;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.operation.Operations;
import org.junit.AfterClass;
import org.junit.BeforeClass;

/**
 * @author Donald G. Dunne
 */
public class MoveTeamWorkflowsOperationTest {

   @BeforeClass
   @AfterClass
   public static void cleanup() throws Exception {
      AtsTestUtil.cleanup();
   }

   @org.junit.Test
   public void testDoWork() throws OseeCoreException {
      AtsTestUtil.cleanupAndReset(getClass().getSimpleName());
      ActionArtifact actArt = AtsTestUtil.getActionArt();
      TeamWorkFlowArtifact teamWf = AtsTestUtil.getTeamWf();

      ActionArtifact actArt2 = AtsTestUtil.getActionArt2();
      TeamWorkFlowArtifact teamWf2 = AtsTestUtil.getTeamWf2();

      MoveTeamWorkflowsOperation operation =
         new MoveTeamWorkflowsOperation("Move", teamWf, Arrays.asList(teamWf2), "new title");
      Operations.executeWorkAndCheckStatus(operation);

      Assert.assertEquals("Parent Actions should be same", teamWf.getParentActionArtifact(),
         teamWf.getParentActionArtifact());
      Assert.assertEquals("new title", actArt.getName());
      Assert.assertTrue("Action Artifact 2 should be deleted", actArt2.isDeleted());
      Assert.assertFalse("No artifact should be dirty",
         actArt.isDirty() && teamWf.isDirty() && actArt2.isDirty() && teamWf2.isDirty());
   }
}

Back to the top