forked from strongback/strongback-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support CommandGroups in CommandTester, closes strongback#111.
- Loading branch information
Showing
5 changed files
with
78 additions
and
40 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
27 changes: 27 additions & 0 deletions
27
strongback-tests/src/org/strongback/command/CommandTesterTest.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.strongback.command; | ||
|
||
import org.junit.Test; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
import static org.fest.assertions.Assertions.assertThat; | ||
|
||
/** | ||
* @author Rothanak So | ||
*/ | ||
public class CommandTesterTest { | ||
|
||
@Test | ||
public void shouldSupportCommandGroups() { | ||
// Regression test for issue #111: https://github.com/strongback/strongback-java/issues/111 | ||
Command command = Command.pause(100, TimeUnit.MILLISECONDS); | ||
WatchedCommand watched = WatchedCommand.watch(command); // CommandGroups don't call end(), so watch Command | ||
CommandTester tester = new CommandTester(CommandGroup.runSequentially(watched)); | ||
|
||
tester.step(1); | ||
assertThat(watched.isEnded()).isFalse(); | ||
|
||
tester.step(101); | ||
assertThat(watched.isEnded()).isTrue(); | ||
} | ||
} |
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