diff options
author | donald.g.dunne | 2017-04-11 03:02:15 +0000 |
---|---|---|
committer | donald.g.dunne | 2017-04-17 16:58:29 +0000 |
commit | be1aa581e9edb6e6eeb624e073109a508b1e7da2 (patch) | |
tree | 74ed18d628fda082fd679e37d50a61cb17b41440 /plugins/org.eclipse.osee.ats.client.integration.tests | |
parent | a2fee6dcf131b64c3618d1f42d99a3b457a48b33 (diff) | |
download | org.eclipse.osee-be1aa581e9edb6e6eeb624e073109a508b1e7da2.tar.gz org.eclipse.osee-be1aa581e9edb6e6eeb624e073109a508b1e7da2.tar.xz org.eclipse.osee-be1aa581e9edb6e6eeb624e073109a508b1e7da2.zip |
refactor: Move ActionManager.createAction to services
Change-Id: Ice2a5aa08d610d384d150bed03f5a3c4f58d4faa
Diffstat (limited to 'plugins/org.eclipse.osee.ats.client.integration.tests')
10 files changed, 94 insertions, 83 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/actions/DuplicateWorkflowActionTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/actions/DuplicateWorkflowActionTest.java index 1ee669bafdd..acdb02e077b 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/actions/DuplicateWorkflowActionTest.java +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/actions/DuplicateWorkflowActionTest.java @@ -24,9 +24,9 @@ import org.eclipse.osee.ats.api.notify.AtsNotifyType; import org.eclipse.osee.ats.api.team.CreateTeamOption; import org.eclipse.osee.ats.api.user.IAtsUser; import org.eclipse.osee.ats.api.util.IAtsChangeSet; +import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow; import org.eclipse.osee.ats.client.integration.tests.AtsClientService; import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil; -import org.eclipse.osee.ats.core.client.action.ActionManager; import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact; import org.eclipse.osee.ats.core.users.AtsCoreUsers; import org.eclipse.osee.ats.demo.api.DemoUsers; @@ -40,8 +40,8 @@ import org.junit.Test; */ public class DuplicateWorkflowActionTest extends AbstractAtsActionRunTest { - private TeamWorkFlowArtifact newTeamArt; - private TeamWorkFlowArtifact dupArt; + private IAtsTeamWorkflow newTeamWf; + private IAtsTeamWorkflow dupTeamWf; @Override public DuplicateWorkflowAction createAction() throws OseeCoreException { @@ -51,7 +51,7 @@ public class DuplicateWorkflowActionTest extends AbstractAtsActionRunTest { @Test public void testAssigneesAndNotifications() { AtsTestUtil.cleanupAndReset(getClass().getSimpleName()); - TeamWorkFlowArtifact teamWf = AtsTestUtil.getTeamWf(); + IAtsTeamWorkflow teamWf = AtsTestUtil.getTeamWf(); List<IAtsUser> assignees = setupAssignees(teamWf); @@ -60,31 +60,34 @@ public class DuplicateWorkflowActionTest extends AbstractAtsActionRunTest { // new workflow IAtsChangeSet changes = AtsClientService.get().createChangeSet("Duplicate Workflow"); - newTeamArt = ActionManager.createTeamWorkflow(teamWf.getParentActionArtifact(), teamWf.getTeamDefinition(), + newTeamWf = AtsClientService.get().getActionFactory().createTeamWorkflow(teamWf.getParentAction(), + teamWf.getTeamDefinition(), AtsClientService.get().getWorkItemService().getActionableItemService().getActionableItems(teamWf), assignees, changes, new Date(), originator, null, CreateTeamOption.Duplicate_If_Exists); - assertEquals("invalid number of assignees", 2, newTeamArt.getAssignees().size()); + assertEquals("invalid number of assignees", 2, newTeamWf.getAssignees().size()); assertEquals("invalid number of notifications", 2, changes.getNotifications().getWorkItemNotificationEvents().size()); // duplicate workflow - dupArt = - (TeamWorkFlowArtifact) teamWf.duplicate(AtsClientService.get().getAtsBranch(), Arrays.asList(AtsAttributeTypes.AtsId)); - dupArt.initializeNewStateMachine(assignees, new Date(), AtsCoreUsers.SYSTEM_USER, changes); + dupTeamWf = AtsClientService.get().getWorkItemFactory().getTeamWf( + ((TeamWorkFlowArtifact) teamWf.getStoreObject()).duplicate(AtsClientService.get().getAtsBranch(), + Arrays.asList(AtsAttributeTypes.AtsId))); + AtsClientService.get().getActionFactory().initializeNewStateMachine(dupTeamWf, assignees, new Date(), + AtsCoreUsers.SYSTEM_USER, changes); - changes.add(dupArt); + changes.add(dupTeamWf); changes.getNotifications().addWorkItemNotificationEvent( - AtsNotificationEventFactory.getWorkItemNotificationEvent(teamWf.getAssignees().iterator().next(), dupArt, + AtsNotificationEventFactory.getWorkItemNotificationEvent(teamWf.getAssignees().iterator().next(), dupTeamWf, AtsNotifyType.Originator, AtsNotifyType.Assigned, AtsNotifyType.SubscribedTeamOrAi)); assertTrue(changes.getNotifications().getWorkItemNotificationEvents().size() == 4); - assertTrue(dupArt.getAssignees().size() == 2); + assertTrue(dupTeamWf.getAssignees().size() == 2); changes.execute(); } - private List<IAtsUser> setupAssignees(TeamWorkFlowArtifact teamWf) { + private List<IAtsUser> setupAssignees(IAtsTeamWorkflow teamWf) { List<IAtsUser> assignees = new LinkedList<>(); assignees.addAll(teamWf.getAssignees()); IAtsUser lead = @@ -95,12 +98,12 @@ public class DuplicateWorkflowActionTest extends AbstractAtsActionRunTest { @After public void tearDown() throws Exception { - if (newTeamArt != null) { - newTeamArt.deleteAndPersist(); + if (newTeamWf != null) { + ((TeamWorkFlowArtifact) newTeamWf.getStoreObject()).deleteAndPersist(); } - if (dupArt != null) { - dupArt.deleteAndPersist(); + if (dupTeamWf != null) { + ((TeamWorkFlowArtifact) dupTeamWf.getStoreObject()).deleteAndPersist(); } } diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/EstimatedHoursColumnTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/EstimatedHoursColumnTest.java index 3388034609d..04694777c2f 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/EstimatedHoursColumnTest.java +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/EstimatedHoursColumnTest.java @@ -15,6 +15,7 @@ import java.util.Collection; import java.util.Date; import org.eclipse.osee.ats.api.data.AtsAttributeTypes; import org.eclipse.osee.ats.api.util.IAtsChangeSet; +import org.eclipse.osee.ats.api.workflow.IAtsAction; import org.eclipse.osee.ats.api.workflow.IAtsTask; import org.eclipse.osee.ats.client.integration.tests.AtsClientService; import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil; @@ -50,9 +51,9 @@ public class EstimatedHoursColumnTest { TeamWorkFlowArtifact teamArt1 = DemoTestUtil.createSimpleAction(EstimatedHoursColumnTest.class.getSimpleName(), changes); - Artifact actionArt = teamArt1.getParentActionArtifact(); + IAtsAction action = teamArt1.getParentAction(); TeamWorkFlowArtifact teamArt2 = - DemoTestUtil.addTeamWorkflow(actionArt, EstimatedHoursColumnTest.class.getSimpleName(), changes); + DemoTestUtil.addTeamWorkflow(action, EstimatedHoursColumnTest.class.getSimpleName(), changes); PeerToPeerReviewArtifact peerArt = PeerToPeerReviewManager.createNewPeerToPeerReview(teamArt1, getClass().getSimpleName(), teamArt1.getStateMgr().getCurrentStateName(), changes); changes.add(peerArt); @@ -71,7 +72,7 @@ public class EstimatedHoursColumnTest { } } - Assert.assertEquals(0.0, EstimatedHoursUtil.getEstimatedHours(actionArt), 0); + Assert.assertEquals(0.0, EstimatedHoursUtil.getEstimatedHours(action), 0); Assert.assertEquals(0.0, EstimatedHoursUtil.getEstimatedHours(teamArt1), 0); Assert.assertEquals(0.0, EstimatedHoursUtil.getEstimatedHours(teamArt2), 0); Assert.assertEquals(0.0, EstimatedHoursUtil.getEstimatedHours(taskArt1), 0); @@ -80,7 +81,7 @@ public class EstimatedHoursColumnTest { teamArt1.setSoleAttributeValue(AtsAttributeTypes.EstimatedHours, 1.4); teamArt1.persist(getClass().getSimpleName()); - Assert.assertEquals(1.4, EstimatedHoursUtil.getEstimatedHours(actionArt), 0); + Assert.assertEquals(1.4, EstimatedHoursUtil.getEstimatedHours(action), 0); Assert.assertEquals(1.4, EstimatedHoursUtil.getEstimatedHours(teamArt1), 0); Assert.assertEquals(0.0, EstimatedHoursUtil.getEstimatedHours(teamArt2), 0); Assert.assertEquals(0.0, EstimatedHoursUtil.getEstimatedHours(taskArt1), 0); @@ -91,7 +92,7 @@ public class EstimatedHoursColumnTest { taskArt1.setSoleAttributeValue(AtsAttributeTypes.EstimatedHours, 1.4); taskArt1.persist(getClass().getSimpleName()); - Assert.assertEquals(2.8, EstimatedHoursUtil.getEstimatedHours(actionArt), 0); + Assert.assertEquals(2.8, EstimatedHoursUtil.getEstimatedHours(action), 0); Assert.assertEquals(2.8, EstimatedHoursUtil.getEstimatedHours(teamArt1), 0); Assert.assertEquals(0.0, EstimatedHoursUtil.getEstimatedHours(teamArt2), 0); Assert.assertEquals(1.4, EstimatedHoursUtil.getEstimatedHours(taskArt1), 0); @@ -100,7 +101,7 @@ public class EstimatedHoursColumnTest { peerArt.setSoleAttributeValue(AtsAttributeTypes.EstimatedHours, 4.0); peerArt.persist(getClass().getSimpleName()); - Assert.assertEquals(6.8, EstimatedHoursUtil.getEstimatedHours(actionArt), 0); + Assert.assertEquals(6.8, EstimatedHoursUtil.getEstimatedHours(action), 0); Assert.assertEquals(6.8, EstimatedHoursUtil.getEstimatedHours(teamArt1), 0); Assert.assertEquals(0.0, EstimatedHoursUtil.getEstimatedHours(teamArt2), 0); Assert.assertEquals(1.4, EstimatedHoursUtil.getEstimatedHours(taskArt1), 0); @@ -109,7 +110,7 @@ public class EstimatedHoursColumnTest { teamArt2.setSoleAttributeValue(AtsAttributeTypes.EstimatedHours, 2.1); teamArt2.persist(getClass().getSimpleName()); - Assert.assertEquals(8.9, EstimatedHoursUtil.getEstimatedHours(actionArt), 0); + Assert.assertEquals(8.9, EstimatedHoursUtil.getEstimatedHours(action), 0); Assert.assertEquals(6.8, EstimatedHoursUtil.getEstimatedHours(teamArt1), 0); Assert.assertEquals(2.1, EstimatedHoursUtil.getEstimatedHours(teamArt2), 0); Assert.assertEquals(1.4, EstimatedHoursUtil.getEstimatedHours(taskArt1), 0); @@ -119,7 +120,7 @@ public class EstimatedHoursColumnTest { Assert.assertNotNull(taskArt2); taskArt2.setSoleAttributeValue(AtsAttributeTypes.EstimatedHours, 0.1); taskArt2.persist(getClass().getSimpleName()); - Assert.assertEquals(9.0, EstimatedHoursUtil.getEstimatedHours(actionArt), 0); + Assert.assertEquals(9.0, EstimatedHoursUtil.getEstimatedHours(action), 0); Assert.assertEquals(6.9, EstimatedHoursUtil.getEstimatedHours(teamArt1), 0); Assert.assertEquals(2.1, EstimatedHoursUtil.getEstimatedHours(teamArt2), 0); Assert.assertEquals(1.4, EstimatedHoursUtil.getEstimatedHours(taskArt1), 0); diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java index 91689dfb30c..e3f2349f0fc 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java @@ -25,6 +25,7 @@ import org.eclipse.osee.ats.api.team.ChangeType; import org.eclipse.osee.ats.api.team.IAtsTeamDefinition; import org.eclipse.osee.ats.api.util.IAtsChangeSet; import org.eclipse.osee.ats.api.version.IAtsVersion; +import org.eclipse.osee.ats.api.workflow.ActionResult; import org.eclipse.osee.ats.client.integration.tests.AtsClientService; import org.eclipse.osee.ats.config.AtsConfigOperation; import org.eclipse.osee.ats.core.client.action.ActionManager; @@ -161,10 +162,10 @@ public class AtsBranchConfigurationTest { ActionableItems.getActionableItems(appendToName(BRANCH_VIA_VERSIONS, "A1"), AtsClientService.get()); assertFalse(selectedActionableItems.isEmpty()); - Artifact actionArt = ActionManager.createAction(null, BRANCH_VIA_VERSIONS.getName() + " Req Changes", - "description", ChangeType.Problem, "1", false, null, selectedActionableItems, new Date(), - AtsClientService.get().getUserService().getCurrentUser(), null, changes); - TeamWorkFlowArtifact teamWf = ActionManager.getTeams(actionArt).iterator().next(); + ActionResult result = AtsClientService.get().getActionFactory().createAction(null, + BRANCH_VIA_VERSIONS.getName() + " Req Changes", "description", ChangeType.Problem, "1", false, null, + selectedActionableItems, new Date(), AtsClientService.get().getUserService().getCurrentUser(), null, changes); + TeamWorkFlowArtifact teamWf = ActionManager.getTeams(result).iterator().next(); AtsClientService.get().getVersionService().setTargetedVersion(teamWf, versionToTarget, changes); changes.execute(); @@ -271,12 +272,12 @@ public class AtsBranchConfigurationTest { changes.reset("Test branch via team definition: create action"); String actionTitle = BRANCH_VIA_TEAM_DEFINITION.getName() + " Req Changes"; changes.clear(); - Artifact actionArt = ActionManager.createAction(null, actionTitle, "description", ChangeType.Problem, "1", false, - null, selectedActionableItems, new Date(), AtsClientService.get().getUserService().getCurrentUser(), null, - changes); + ActionResult result = AtsClientService.get().getActionFactory().createAction(null, actionTitle, "description", + ChangeType.Problem, "1", false, null, selectedActionableItems, new Date(), + AtsClientService.get().getUserService().getCurrentUser(), null, changes); changes.execute(); - final TeamWorkFlowArtifact teamWf = ActionManager.getTeams(actionArt).iterator().next(); + final TeamWorkFlowArtifact teamWf = ActionManager.getTeams(result).iterator().next(); TeamWorkFlowManager dtwm = new TeamWorkFlowManager(teamWf, AtsClientService.get().getServices()); // Transition to desired state diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java index d2a68c78ff7..95eb5f426ee 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java @@ -38,6 +38,7 @@ import org.eclipse.osee.ats.api.workdef.IStateToken; import org.eclipse.osee.ats.api.workdef.JaxAtsWorkDef; import org.eclipse.osee.ats.api.workdef.StateType; import org.eclipse.osee.ats.api.workdef.model.ReviewBlockType; +import org.eclipse.osee.ats.api.workflow.ActionResult; import org.eclipse.osee.ats.api.workflow.IAtsTask; import org.eclipse.osee.ats.api.workflow.transition.IAtsTransitionManager; import org.eclipse.osee.ats.api.workflow.transition.TransitionOption; @@ -45,7 +46,6 @@ import org.eclipse.osee.ats.api.workflow.transition.TransitionResults; import org.eclipse.osee.ats.client.integration.AtsClientIntegrationTestSuite; import org.eclipse.osee.ats.client.integration.tests.AtsClientService; import org.eclipse.osee.ats.core.client.action.ActionArtifact; -import org.eclipse.osee.ats.core.client.action.ActionManager; import org.eclipse.osee.ats.core.client.actions.ISelectedAtsArtifacts; import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil; import org.eclipse.osee.ats.core.client.config.AtsBulkLoad; @@ -353,11 +353,12 @@ public class AtsTestUtil { AtsUtilClient.createConfigObjectUuid(), changes); changes.relate(teamDef, AtsRelationTypes.TeamDefinitionToVersion_Version, verArt4); - actionArt = ActionManager.createAction(null, getTitle("Team WF", postFixName), "description", - ChangeType.Improvement, "1", false, null, Arrays.asList(testAi), new Date(), - AtsClientService.get().getUserService().getCurrentUser(), null, changes); + ActionResult result = AtsClientService.get().getActionFactory().createAction(null, + getTitle("Team WF", postFixName), "description", ChangeType.Improvement, "1", false, null, + Arrays.asList(testAi), new Date(), AtsClientService.get().getUserService().getCurrentUser(), null, changes); - teamWf = actionArt.getFirstTeam(); + actionArt = (ActionArtifact) result.getAction().getStoreObject(); + teamWf = (TeamWorkFlowArtifact) result.getFirstTeam().getStoreObject(); changes.execute(); } @@ -664,10 +665,12 @@ public class AtsTestUtil { ensureLoaded(); if (teamArt2 == null) { IAtsChangeSet changes = AtsClientService.get().createChangeSet(AtsTestUtil.class.getSimpleName()); - actionArt2 = ActionManager.createAction(null, getTitle("Team WF2", postFixName), "description", - ChangeType.Improvement, "1", false, null, Arrays.asList(testAi2), new Date(), - AtsClientService.get().getUserService().getCurrentUser(), null, changes); - teamArt2 = actionArt2.getFirstTeam(); + ActionResult result = + AtsClientService.get().getActionFactory().createAction(null, getTitle("Team WF2", postFixName), + "description", ChangeType.Improvement, "1", false, null, Arrays.asList(testAi2), new Date(), + AtsClientService.get().getUserService().getCurrentUser(), null, changes); + actionArt2 = (ActionArtifact) result.getAction().getStoreObject(); + teamArt2 = (TeamWorkFlowArtifact) result.getFirstTeam().getStoreObject(); changes.execute(); } return teamArt2; @@ -682,10 +685,12 @@ public class AtsTestUtil { ensureLoaded(); if (teamArt3 == null) { IAtsChangeSet changes = AtsClientService.get().createChangeSet(AtsTestUtil.class.getSimpleName()); - actionArt3 = ActionManager.createAction(null, getTitle("Team WF3", postFixName), "description", - ChangeType.Improvement, "1", false, null, Arrays.asList(testAi3), new Date(), - AtsClientService.get().getUserService().getCurrentUser(), null, changes); - teamArt3 = actionArt3.getFirstTeam(); + ActionResult result = + AtsClientService.get().getActionFactory().createAction(null, getTitle("Team WF3", postFixName), + "description", ChangeType.Improvement, "1", false, null, Arrays.asList(testAi3), new Date(), + AtsClientService.get().getUserService().getCurrentUser(), null, changes); + actionArt3 = (ActionArtifact) result.getAction().getStoreObject(); + teamArt3 = (TeamWorkFlowArtifact) result.getFirstTeam().getStoreObject(); changes.execute(); } return teamArt3; @@ -700,11 +705,12 @@ public class AtsTestUtil { ensureLoaded(); if (teamArt4 == null) { IAtsChangeSet changes = AtsClientService.get().createChangeSet(AtsTestUtil.class.getSimpleName()); - actionArt4 = ActionManager.createAction(null, getTitle("Team WF4", postFixName), "description", - ChangeType.Improvement, "1", false, null, Arrays.asList(testAi4), new Date(), - AtsClientService.get().getUserService().getCurrentUser(), null, changes); - - teamArt4 = actionArt4.getFirstTeam(); + ActionResult result = + AtsClientService.get().getActionFactory().createAction(null, getTitle("Team WF4", postFixName), + "description", ChangeType.Improvement, "1", false, null, Arrays.asList(testAi4), new Date(), + AtsClientService.get().getUserService().getCurrentUser(), null, changes); + actionArt4 = (ActionArtifact) result.getAction().getStoreObject(); + teamArt4 = (TeamWorkFlowArtifact) result.getFirstTeam().getStoreObject(); AtsClientService.get().getVersionService().setTargetedVersion(teamArt4, verArt4, changes); changes.execute(); } diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/resource/StateResourceTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/resource/StateResourceTest.java index bb002d1a2ae..2b2ca399765 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/resource/StateResourceTest.java +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/resource/StateResourceTest.java @@ -24,9 +24,8 @@ import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriBuilder; import org.eclipse.osee.ats.api.team.ChangeType; import org.eclipse.osee.ats.api.util.IAtsChangeSet; +import org.eclipse.osee.ats.api.workflow.ActionResult; import org.eclipse.osee.ats.client.integration.tests.AtsClientService; -import org.eclipse.osee.ats.core.client.action.ActionArtifact; -import org.eclipse.osee.ats.core.client.action.ActionManager; import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact; import org.eclipse.osee.ats.core.config.ActionableItems; import org.eclipse.osee.ats.demo.api.DemoActionableItems; @@ -86,13 +85,13 @@ public class StateResourceTest extends AbstractRestTest { form.param("operation", "transition"); IAtsChangeSet changes = AtsClientService.get().createChangeSet(StateResourceTest.class.getName()); - ActionArtifact action = ActionManager.createAction(null, StateResourceTest.class.getName(), "description", - ChangeType.Improvement, "1", false, null, + ActionResult result = AtsClientService.get().getActionFactory().createAction(null, + StateResourceTest.class.getName(), "description", ChangeType.Improvement, "1", false, null, ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName()), AtsClientService.get()), new Date(), AtsClientService.get().getUserServiceClient().getUserFromToken(DemoUsers.Joe_Smith), null, changes); - TeamWorkFlowArtifact teamWf = action.getFirstTeam(); + TeamWorkFlowArtifact teamWf = (TeamWorkFlowArtifact) result.getFirstTeam().getStoreObject(); changes.execute(); Assert.assertEquals("Endorse", teamWf.getCurrentStateName()); diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/AtsDeleteManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/AtsDeleteManagerTest.java index 3fa0209e5e3..4feaba52ce9 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/AtsDeleteManagerTest.java +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/AtsDeleteManagerTest.java @@ -22,6 +22,7 @@ import org.eclipse.osee.ats.api.team.ChangeType; import org.eclipse.osee.ats.api.user.IAtsUser; import org.eclipse.osee.ats.api.util.IAtsChangeSet; import org.eclipse.osee.ats.api.workdef.model.ReviewBlockType; +import org.eclipse.osee.ats.api.workflow.ActionResult; import org.eclipse.osee.ats.client.integration.tests.AtsClientService; import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil; import org.eclipse.osee.ats.client.integration.tests.util.DemoTestUtil; @@ -184,11 +185,11 @@ public class AtsDeleteManagerTest { Date createdDate = new Date(); IAtsUser createdBy = AtsClientService.get().getUserService().getCurrentUser(); - Artifact actionArt = ActionManager.createAction(null, testName.name(), "Description", ChangeType.Improvement, "2", - false, null, actionableItems, createdDate, createdBy, null, changes); + ActionResult result = AtsClientService.get().getActionFactory().createAction(null, testName.name(), "Description", + ChangeType.Improvement, "2", false, null, actionableItems, createdDate, createdBy, null, changes); TeamWorkFlowArtifact teamArt = null; - for (TeamWorkFlowArtifact team : ActionManager.getTeams(actionArt)) { + for (TeamWorkFlowArtifact team : ActionManager.getTeams(result)) { if (team.getTeamDefinition().getName().contains("Code")) { teamArt = team; } diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/CreateActionUsingAllActionableItemsTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/CreateActionUsingAllActionableItemsTest.java index 94d7b8b4c63..94aec1b11b2 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/CreateActionUsingAllActionableItemsTest.java +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/CreateActionUsingAllActionableItemsTest.java @@ -10,8 +10,8 @@ *******************************************************************************/ package org.eclipse.osee.ats.client.integration.tests.ats.util; +import org.eclipse.osee.ats.api.workflow.ActionResult; import org.eclipse.osee.ats.client.integration.tests.AtsClientService; -import org.eclipse.osee.ats.core.client.action.ActionArtifact; import org.eclipse.osee.ats.core.client.config.AtsBulkLoad; import org.eclipse.osee.ats.util.CreateActionUsingAllActionableItems; import org.eclipse.osee.framework.core.enums.DeletionFlag; @@ -49,7 +49,7 @@ public class CreateActionUsingAllActionableItemsTest { @org.junit.Test public void test() throws Exception { SevereLoggingMonitor monitor = TestUtil.severeLoggingStart(); - ActionArtifact action = CreateActionUsingAllActionableItems.createActionWithAllAis(); + ActionResult action = CreateActionUsingAllActionableItems.createActionWithAllAis(); if (TestUtil.isDemoDb()) { Assert.assertEquals("Should be 15 workflows created", 15, action.getTeams().size()); } else { diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/CreateTaskRuleTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/CreateTaskRuleTest.java index b8e726f2fa8..06bb478dda6 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/CreateTaskRuleTest.java +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/CreateTaskRuleTest.java @@ -22,16 +22,14 @@ import org.eclipse.osee.ats.api.workdef.AddRuleData; import org.eclipse.osee.ats.api.workdef.CreateTaskRuleDefinition; import org.eclipse.osee.ats.api.workdef.IAtsRuleDefinition; import org.eclipse.osee.ats.api.workdef.NullRuleDefinition; -import org.eclipse.osee.ats.api.workflow.IAtsAction; +import org.eclipse.osee.ats.api.workflow.ActionResult; import org.eclipse.osee.ats.api.workflow.IAtsTask; -import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow; import org.eclipse.osee.ats.client.integration.tests.AtsClientService; import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil; import org.eclipse.osee.ats.core.client.IAtsClient; import org.eclipse.osee.ats.core.config.ActionableItems; import org.eclipse.osee.ats.demo.api.DemoArtifactToken; import org.eclipse.osee.framework.core.data.ArtifactToken; -import org.eclipse.osee.framework.jdk.core.type.Pair; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.junit.After; import org.junit.Assert; @@ -118,14 +116,14 @@ public class CreateTaskRuleTest { // Create new Workflow - rule should be triggered IAtsUser currentUser = atsClient.getUserService().getCurrentUser(); IAtsChangeSet changes = atsClient.getStoreService().createAtsChangeSet(getClass().getSimpleName(), currentUser); - Pair<IAtsAction, Collection<IAtsTeamWorkflow>> pair = atsClient.getActionFactory().createAction(currentUser, - getClass().getSimpleName(), title, ChangeType.Improvement, "priority", false, null, + ActionResult result = atsClient.getActionFactory().createAction(currentUser, getClass().getSimpleName(), title, + ChangeType.Improvement, "priority", false, null, ActionableItems.getActionableItems(Arrays.asList(actionableItem.getName()), AtsClientService.get()), new Date(), currentUser, null, changes); changes.execute(); // verify that tasks have been created - Collection<IAtsTask> tasks = atsClient.getTaskService().getTasks(pair.getSecond().iterator().next()); + Collection<IAtsTask> tasks = atsClient.getTaskService().getTasks(result.getFirstTeam()); Assert.assertEquals("There can be only one", 1, tasks.size()); IAtsTask next = tasks.iterator().next(); Assert.assertEquals("Name should be *Create a Task from Rule*", "Create a Task from Rule - CreateTaskRuleTest", diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/DemoTeamWorkflowTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/DemoTeamWorkflowTest.java index a812ec0e596..a60e24a2432 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/DemoTeamWorkflowTest.java +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/DemoTeamWorkflowTest.java @@ -11,13 +11,12 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem; import org.eclipse.osee.ats.api.team.ChangeType; import org.eclipse.osee.ats.api.util.IAtsChangeSet; import org.eclipse.osee.ats.api.version.IAtsVersion; +import org.eclipse.osee.ats.api.workflow.ActionResult; import org.eclipse.osee.ats.api.workflow.transition.IAtsTransitionManager; import org.eclipse.osee.ats.api.workflow.transition.TransitionOption; import org.eclipse.osee.ats.api.workflow.transition.TransitionResults; import org.eclipse.osee.ats.client.integration.tests.AtsClientService; 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.action.ActionManager; import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil; import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact; import org.eclipse.osee.ats.core.workflow.state.TeamState; @@ -55,10 +54,11 @@ public class DemoTeamWorkflowTest { IAtsChangeSet changes = AtsClientService.get().createChangeSet("Create SAW Test Action title: " + title); - ActionArtifact actionArt = ActionManager.createAction(null, title, title, ChangeType.Improvement, "1", false, - null, aias, new Date(), AtsClientService.get().getUserService().getCurrentUser(), null, changes); + ActionResult result = + AtsClientService.get().getActionFactory().createAction(null, title, title, ChangeType.Improvement, "1", false, + null, aias, new Date(), AtsClientService.get().getUserService().getCurrentUser(), null, changes); - TeamWorkFlowArtifact teamWf = actionArt.getFirstTeam(); + TeamWorkFlowArtifact teamWf = (TeamWorkFlowArtifact) result.getFirstTeam().getStoreObject(); //*** Transition Action to Analyze TransitionHelper helper = new TransitionHelper("Transition to Analyze", Arrays.asList(teamWf), diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java index 0b797eedba6..ec67782229c 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java @@ -29,6 +29,8 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes; import org.eclipse.osee.ats.api.team.ChangeType; import org.eclipse.osee.ats.api.team.IAtsTeamDefinition; import org.eclipse.osee.ats.api.util.IAtsChangeSet; +import org.eclipse.osee.ats.api.workflow.ActionResult; +import org.eclipse.osee.ats.api.workflow.IAtsAction; import org.eclipse.osee.ats.api.workflow.IAtsTask; import org.eclipse.osee.ats.client.integration.tests.AtsClientService; import org.eclipse.osee.ats.core.client.action.ActionManager; @@ -36,7 +38,6 @@ import org.eclipse.osee.ats.core.client.task.TaskArtifact; import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact; import org.eclipse.osee.ats.core.config.ActionableItems; import org.eclipse.osee.ats.core.config.TeamDefinitions; -import org.eclipse.osee.ats.core.util.AtsUtilCore; import org.eclipse.osee.ats.demo.api.DemoActionableItems; import org.eclipse.osee.ats.demo.api.DemoArtifactTypes; import org.eclipse.osee.ats.demo.api.DemoTeam; @@ -100,14 +101,14 @@ public class DemoTestUtil { * Creates an action with the name title and demo code workflow */ public static TeamWorkFlowArtifact createSimpleAction(String title, IAtsChangeSet changes) throws OseeCoreException { - Artifact actionArt = - ActionManager.createAction(null, title, "Description", ChangeType.Improvement, "2", false, null, - ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName()), - AtsClientService.get()), - new Date(), AtsClientService.get().getUserService().getCurrentUser(), null, changes); + ActionResult result = AtsClientService.get().getActionFactory().createAction(null, title, "Description", + ChangeType.Improvement, "2", false, null, + ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName()), + AtsClientService.get()), + new Date(), AtsClientService.get().getUserService().getCurrentUser(), null, changes); TeamWorkFlowArtifact teamArt = null; - for (TeamWorkFlowArtifact team : ActionManager.getTeams(actionArt)) { + for (TeamWorkFlowArtifact team : ActionManager.getTeams(result)) { if (team.getTeamDefinition().getName().contains("Code")) { teamArt = team; } @@ -123,16 +124,16 @@ public class DemoTestUtil { return getActionableItems(demoActionableItems).iterator().next(); } - public static TeamWorkFlowArtifact addTeamWorkflow(Artifact actionArt, String title, IAtsChangeSet changes) throws OseeCoreException { + public static TeamWorkFlowArtifact addTeamWorkflow(IAtsAction action, String title, IAtsChangeSet changes) throws OseeCoreException { Set<IAtsActionableItem> actionableItems = getActionableItems(DemoActionableItems.SAW_Test); Collection<IAtsTeamDefinition> teamDefs = TeamDefinitions.getImpactedTeamDefs(actionableItems); - ActionManager.createTeamWorkflow(actionArt, teamDefs.iterator().next(), actionableItems, + AtsClientService.get().getActionFactory().createTeamWorkflow(action, teamDefs.iterator().next(), actionableItems, Arrays.asList(AtsClientService.get().getUserService().getCurrentUser()), changes, new Date(), AtsClientService.get().getUserService().getCurrentUser(), null); TeamWorkFlowArtifact teamArt = null; - for (TeamWorkFlowArtifact team : ActionManager.getTeams(actionArt)) { + for (TeamWorkFlowArtifact team : ActionManager.getTeams(action)) { if (team.getTeamDefinition().getName().contains("Test")) { teamArt = team; } @@ -171,7 +172,8 @@ public class DemoTestUtil { if (unCommittedWorkflows == null) { unCommittedWorkflows = new HashMap<>(); for (Artifact art : ArtifactQuery.getArtifactListFromName( - "SAW (uncommitted) More Reqt Changes for Diagram View", AtsClientService.get().getAtsBranch(), EXCLUDE_DELETED)) { + "SAW (uncommitted) More Reqt Changes for Diagram View", AtsClientService.get().getAtsBranch(), + EXCLUDE_DELETED)) { if (art.isOfType(DemoArtifactTypes.DemoCodeTeamWorkflow)) { unCommittedWorkflows.put(DemoWorkType.Code, art); } else if (art.isOfType(DemoArtifactTypes.DemoTestTeamWorkflow)) { |