-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplify step interface by consolidating step and heartbeat timeouts
- Loading branch information
John Roesler
committed
Dec 30, 2016
1 parent
f506949
commit a129373
Showing
22 changed files
with
104 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 8 additions & 12 deletions
20
sswf-core/src/it/scala/com/bazaarvoice/sswf/ListOpenExecutionTestSteps.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 7 additions & 14 deletions
21
sswf-core/src/it/scala/com/bazaarvoice/sswf/TestSteps.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
package com.bazaarvoice.sswf; | ||
|
||
public enum TestSteps implements WorkflowStep { | ||
INPROGRESS_STEP(120, 120) { | ||
@Override public InProgressTimerFunction inProgressTimerSecondsFn() { | ||
INPROGRESS_STEP(120) { | ||
@Override public InProgressSleepFunction inProgressSleepSecondsFn() { | ||
return (invocationNum, cumulativeStepDurationSeconds) -> 1; | ||
} | ||
}; | ||
|
||
private int startToFinishTimeout; | ||
private int startToHeartbeatTimeoutSeconds; | ||
private int timeout; | ||
|
||
TestSteps(final int startToFinishTimeout, final int startToHeartbeatTimeoutSeconds) { | ||
this.startToFinishTimeout = startToFinishTimeout; | ||
this.startToHeartbeatTimeoutSeconds = startToHeartbeatTimeoutSeconds; | ||
TestSteps(final int timeout) { | ||
this.timeout = timeout; | ||
} | ||
|
||
@Override public int startToFinishTimeoutSeconds() { | ||
return startToFinishTimeout; | ||
@Override public int timeoutSeconds() { | ||
return timeout; | ||
} | ||
|
||
@Override public int startToHeartbeatTimeoutSeconds() { return startToHeartbeatTimeoutSeconds; } | ||
|
||
|
||
|
||
} |
23 changes: 9 additions & 14 deletions
23
sswf-core/src/it/scala/com/bazaarvoice/sswf/WaitTimeSteps.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
package com.bazaarvoice.sswf; | ||
|
||
public enum WaitTimeSteps implements WorkflowStep { | ||
DUMMY_STEP(120, 120), | ||
WAIT_STEP(120, 120); | ||
DUMMY_STEP(120), | ||
WAIT_STEP(120); | ||
|
||
private int startToFinishTimeout; | ||
private int startToHeartbeatTimeoutSeconds; | ||
private int timeout; | ||
|
||
WaitTimeSteps(final int startToFinishTimeout, final int startToHeartbeatTimeoutSeconds) { | ||
this.startToFinishTimeout = startToFinishTimeout; | ||
this.startToHeartbeatTimeoutSeconds = startToHeartbeatTimeoutSeconds; | ||
WaitTimeSteps(final int timeout) { | ||
this.timeout = timeout; | ||
} | ||
|
||
@Override public int startToFinishTimeoutSeconds() { | ||
return startToFinishTimeout; | ||
} | ||
|
||
@Override public int startToHeartbeatTimeoutSeconds() { return startToHeartbeatTimeoutSeconds; } | ||
|
||
@Override public InProgressTimerFunction inProgressTimerSecondsFn() { | ||
@Override public InProgressSleepFunction inProgressSleepSecondsFn() { | ||
return (invocationNum, cumulativeStepDurationSeconds) -> Math.min(invocationNum * 2, 4); | ||
} | ||
|
||
@Override public int timeoutSeconds() { | ||
return timeout; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
sswf-guava-20/src/main/scala/com/bazaarvoice/sswf/service/DecisionService.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.