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
Make ut_documentation_reporter the default for commandline
Fixes #170
  • Loading branch information
pesse committed Dec 10, 2019
commit ebda7369922a9566f6fdabfd5c6e892089232951
2 changes: 1 addition & 1 deletion src/main/java/org/utplsql/cli/RunPicocliCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class RunPicocliCommand implements IRunCommand {
private List<Format> reporters = new ArrayList<>();

static class Format {
@Option(names = {"-f", "--format"}, required = true, description = "Enables specified format reporting")
@Option(names = {"-f", "--format"}, required = true, description = "Enables specified format reporting", defaultValue = "ut_documentation_reporter")
String format;
@Option(names = {"-o"}, description = "Outputs format to file")
String outputFile;
Expand Down
14 changes: 14 additions & 0 deletions src/test/java/org/utplsql/cli/PicocliRunCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,20 @@ void multipleReporters() throws Exception {
assertTrue(reporterConfig.isForceToScreen());
}

@Test
void outputWithDefaultReporter() throws Exception {
RunCommandConfig config = parseForConfig("run",
TestHelper.getConnectionString(),
"-o=output1.txt");

assertNotNull( config.getReporters() );

ReporterConfig reporterConfig = config.getReporters()[0];
assertEquals("ut_documentation_reporter", reporterConfig.getName());
assertEquals("output1.txt", reporterConfig.getOutput());
assertFalse(reporterConfig.isForceToScreen());
}

@Test
void sourceFileMapping() throws Exception {
RunCommandConfig config = parseForConfig("run",
Expand Down
14 changes: 14 additions & 0 deletions src/test/java/org/utplsql/cli/RunCommandIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,18 @@ void run_withDbmsOutputEnabled() throws Exception {

assertValidReturnCode(result);
}

@Test
void run_withOutputButNoReporterDefined() throws Exception {

String outputFileName = "output_" + System.currentTimeMillis() + ".xml";
addTempPath(Paths.get(outputFileName));

int result = TestHelper.runApp("run",
TestHelper.getConnectionString(),
"-o=" + outputFileName,
"--failure-exit-code=2");

assertValidReturnCode(result);
}
}