Skip to content

Commit 02aa121

Browse files
committed
First failing test for new parameter
1 parent e1fdabb commit 02aa121

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@
8181
<version>${junit.jupiter.version}</version>
8282
<scope>test</scope>
8383
</dependency>
84+
<dependency>
85+
<groupId>org.hamcrest</groupId>
86+
<artifactId>hamcrest</artifactId>
87+
<version>2.1</version>
88+
<scope>test</scope>
89+
</dependency>
8490

8591
</dependencies>
8692

src/main/java/org/utplsql/cli/RunCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public int run() {
228228
return Cli.DEFAULT_ERROR_CODE;
229229
}
230230

231-
private TestRunner newTestRunner( List<Reporter> reporterList) {
231+
TestRunner newTestRunner( List<Reporter> reporterList) {
232232

233233
final File baseDir = new File("").getAbsoluteFile();
234234

src/test/java/org/utplsql/cli/RunCommandTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
package org.utplsql.cli;
22

33
import org.junit.jupiter.api.Test;
4+
import org.utplsql.api.TestRunnerOptions;
45
import org.utplsql.api.reporter.CoreReporters;
56

7+
import java.util.ArrayList;
68
import java.util.List;
79

10+
import static org.hamcrest.CoreMatchers.equalTo;
11+
import static org.hamcrest.MatcherAssert.assertThat;
812
import static org.junit.jupiter.api.Assertions.*;
913

1014
/**
@@ -92,4 +96,13 @@ void connectionString_asSysdba() {
9296
assertEquals("sys as sysdba/mypass@connectstring/service",
9397
runCmd.getConnectionInfo().getConnectionString());
9498
}
99+
100+
@Test
101+
void randomOrder_withoutSeed() {
102+
RunCommand runCmd = TestHelper.createRunCommand(TestHelper.getConnectionString(),
103+
"-random");
104+
105+
TestRunnerOptions options = runCmd.newTestRunner(new ArrayList<>()).getOptions();
106+
assertThat(options.randomTestOrder, equalTo(true));
107+
}
95108
}

0 commit comments

Comments
 (0)