stepNum should be an integer in WorkflowStepContextState

This commit is contained in:
Greg Schueler 2014-01-18 10:51:14 -08:00
parent 1a1e610b20
commit b1c15fc07b
5 changed files with 13 additions and 12 deletions

View file

@ -13,7 +13,7 @@ public class RundeckExecutionState extends WorkflowState{
private Map<String, List<WorkflowStepContextState>> nodeStates;
/**
* Return the set of all rundeck nodes targetted in this execution
* Return the set of all rundeck nodes targeted in this execution
* @return
*/
public Set<RundeckNodeIdentity> getAllNodes() {

View file

@ -5,7 +5,7 @@ package org.rundeck.api.domain;
*/
public class WorkflowStepContextState extends BaseState {
private String stepContextId;
private String stepNum;
private int stepNum;
/**
* The context id for the step in the form "#[/#[/#[...]]]" where "#" is a number
@ -23,11 +23,11 @@ public class WorkflowStepContextState extends BaseState {
* The step number of this step in the current workflow, 1 indexed.
* @return
*/
public String getStepNum() {
public int getStepNum() {
return stepNum;
}
public void setStepNum(String stepNum) {
public void setStepNum(int stepNum) {
this.stepNum = stepNum;
}
}

View file

@ -28,7 +28,7 @@ public class WorkflowStepStateParser implements XmlNodeParser<WorkflowStepState>
BaseStateParser.parseBaseState(targetNode, state);
state.setStepContextId(StringUtils.trimToNull(targetNode.valueOf("@stepctx")));
state.setStepNum(StringUtils.trimToNull(targetNode.valueOf("@id")));
state.setStepNum(Integer.valueOf(targetNode.valueOf("@id")));
state.setNodeStep(Boolean.valueOf(StringUtils.trimToNull(targetNode.valueOf("nodeStep"))));
if (Boolean.valueOf(StringUtils.trimToNull(targetNode.valueOf("hasSubworkflow")))) {
//parse sub workflow

View file

@ -83,11 +83,12 @@ h2. RunDeck API version 9
* list running executions across all projects - OK
* include project name in execution results - OK
* Add uuidOption parameter to allow removing imported UUIDs to avoid creation conflicts - OK
h2. RunDeck API version 10
[Documentation of the RunDeck API version 10|http://rundeck.org/2.0.0/api/index.html]
* Execution State - Retrieve workflow step and node state information - *TODO*
* Execution State - Retrieve workflow step and node state information - OK
* Execution Output with State - Retrieve log output with state change information - OK
* Execution Output - Retrieve log output for a particular node or step - OK
* Execution Info - added successfulNodes and failedNodes detail. - OK

View file

@ -26,7 +26,7 @@ public class WorkflowStepStateParserTest {
Assert.assertEquals(null, stepState.getSubWorkflow());
Assert.assertNotNull(stepState.getNodeStates());
Assert.assertEquals("1", stepState.getStepContextId());
Assert.assertEquals("1", stepState.getStepNum());
Assert.assertEquals(1, stepState.getStepNum());
Assert.assertEquals(1390066159000L, stepState.getStartTime().getTime());
Assert.assertEquals(1390066160000L, stepState.getEndTime().getTime());
Assert.assertEquals(1390066160000L, stepState.getUpdateTime().getTime());
@ -42,7 +42,7 @@ public class WorkflowStepStateParserTest {
Assert.assertTrue(expectedTargetNodes.contains(s));
WorkflowStepContextState workflowStepContextState = stepState.getNodeStates().get(s);
Assert.assertEquals("1", workflowStepContextState.getStepContextId());
Assert.assertEquals("1", workflowStepContextState.getStepNum());
Assert.assertEquals(1, workflowStepContextState.getStepNum());
Assert.assertEquals(1390066159000L + (i * 1000), workflowStepContextState.getStartTime().getTime());
Assert.assertEquals(1390066159000L + (i * 1000), workflowStepContextState.getEndTime().getTime());
Assert.assertEquals(1390066159000L + (i * 1000), workflowStepContextState.getUpdateTime().getTime());
@ -63,7 +63,7 @@ public class WorkflowStepStateParserTest {
Assert.assertEquals(true, stepState.isNodeStep());
Assert.assertEquals(null, stepState.getSubWorkflow());
Assert.assertEquals("1", stepState.getStepContextId());
Assert.assertEquals("1", stepState.getStepNum());
Assert.assertEquals(1, stepState.getStepNum());
Assert.assertNotNull(stepState.getNodeStates());
Assert.assertEquals(1390066061000L, stepState.getStartTime().getTime());
Assert.assertEquals(1390066066000L, stepState.getEndTime().getTime());
@ -75,7 +75,7 @@ public class WorkflowStepStateParserTest {
WorkflowStepContextState workflowStepContextState = stepState.getNodeStates().get("dignan");
Assert.assertEquals("1", workflowStepContextState.getStepContextId());
Assert.assertEquals("1", workflowStepContextState.getStepNum());
Assert.assertEquals(1, workflowStepContextState.getStepNum());
Assert.assertEquals(1390066061000L, workflowStepContextState.getStartTime().getTime());
Assert.assertEquals(1390066066000L, workflowStepContextState.getEndTime().getTime());
Assert.assertEquals(1390066066000L, workflowStepContextState.getUpdateTime().getTime());
@ -95,7 +95,7 @@ public class WorkflowStepStateParserTest {
Assert.assertNotNull(stepState.getSubWorkflow());
Assert.assertNull(stepState.getNodeStates());
Assert.assertEquals("2", stepState.getStepContextId());
Assert.assertEquals("2",stepState.getStepNum());
Assert.assertEquals(2, stepState.getStepNum());
Assert.assertEquals(1390066066000L, stepState.getStartTime().getTime());
Assert.assertNull(stepState.getEndTime());
Assert.assertEquals(1390066066000L, stepState.getUpdateTime().getTime());
@ -112,7 +112,7 @@ public class WorkflowStepStateParserTest {
Assert.assertNull(stepState1.getSubWorkflow());
Assert.assertNotNull(stepState1.getNodeStates());
Assert.assertEquals("2/1", stepState1.getStepContextId());
Assert.assertEquals("1", stepState1.getStepNum());
Assert.assertEquals(1, stepState1.getStepNum());
Assert.assertEquals(1390066067000L, stepState1.getStartTime().getTime());
Assert.assertNull(stepState1.getEndTime());
Assert.assertEquals(1390066067000L, stepState1.getUpdateTime().getTime());