Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
New parameter -random
  • Loading branch information
pesse committed Apr 4, 2019
commit 277091a9ec5a64db078be99a0d1c5f18d1dbae56
9 changes: 8 additions & 1 deletion src/main/java/org/utplsql/cli/RunCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ public class RunCommand implements ICommand {
)
private boolean enableDbmsOutput = false;

@Parameter(
names = {"-random", "--random_test_order"},
description = "Enables random order of test executions (default: DISABLED)"
)
private boolean randomTestOrder = false;

private CompatibilityProxy compatibilityProxy;
private ReporterFactory reporterFactory;
private ReporterManager reporterManager;
Expand Down Expand Up @@ -241,7 +247,8 @@ TestRunner newTestRunner( List<Reporter> reporterList) {
.failOnErrors(true)
.skipCompatibilityCheck(skipCompatibilityCheck)
.includeObjects(getObjectList(includeObjects))
.excludeObjects(getObjectList(excludeObjects));
.excludeObjects(getObjectList(excludeObjects))
.randomTestOrder(randomTestOrder);
}

private ArrayList<String> getObjectList(String includeObjects) {
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/org/utplsql/cli/RunCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.List;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.*;

Expand Down Expand Up @@ -104,5 +105,6 @@ void randomOrder_withoutSeed() {

TestRunnerOptions options = runCmd.newTestRunner(new ArrayList<>()).getOptions();
assertThat(options.randomTestOrder, equalTo(true));
assertThat(options.randomTestOrderSeed, nullValue());
}
}