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
Api package changes
  • Loading branch information
viniciusam committed May 22, 2017
commit 8a9b66f9dd5790f4086a380a1d81adc152d23872
8 changes: 4 additions & 4 deletions src/main/java/io/github/utplsql/cli/ReporterOptions.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.utplsql.cli;

import io.github.utplsql.api.types.BaseReporter;
import io.github.utplsql.api.reporter.Reporter;

/**
* Created by Vinicius on 20/05/2017.
Expand All @@ -12,7 +12,7 @@ public class ReporterOptions {
private boolean outputToScreen;
private boolean forceOutputToScreen;

private BaseReporter reporterObj = null;
private Reporter reporterObj = null;

public ReporterOptions(String reporterName, String outputFileName, boolean outputToScreen) {
setReporterName(reporterName);
Expand All @@ -25,11 +25,11 @@ public ReporterOptions(String reporterName) {
this(reporterName, null, true);
}

public BaseReporter getReporterObj() {
public Reporter getReporterObj() {
return reporterObj;
}

public void setReporterObj(BaseReporter reporterObj) {
public void setReporterObj(Reporter reporterObj) {
this.reporterObj = reporterObj;
}

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/io/github/utplsql/cli/RunCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import io.github.utplsql.api.CustomTypes;
import io.github.utplsql.api.OutputBuffer;
import io.github.utplsql.api.TestRunner;
import io.github.utplsql.api.types.BaseReporter;
import io.github.utplsql.api.types.CustomTypes;
import io.github.utplsql.api.reporter.Reporter;
import io.github.utplsql.api.reporter.ReporterFactory;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
Expand Down Expand Up @@ -83,15 +84,15 @@ public void run() throws Exception {
System.out.println("Running Tests For: " + ci.toString());

final List<ReporterOptions> reporterOptionsList = getReporterOptionsList();
final List<BaseReporter> reporterList = new ArrayList<>();
final List<Reporter> reporterList = new ArrayList<>();
final List<String> testPaths = getTestPaths();

if (testPaths.isEmpty()) testPaths.add(ci.getUser());

// Do the reporters initialization, so we can use the id to run and gather results.
try (Connection conn = ci.getConnection()) {
for (ReporterOptions ro : reporterOptionsList) {
BaseReporter reporter = CustomTypes.createReporter(ro.getReporterName());
Reporter reporter = ReporterFactory.createReporter(ro.getReporterName());
reporter.init(conn);
ro.setReporterObj(reporter);
reporterList.add(reporter);
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/io/github/utplsql/cli/RunCommandTest.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.utplsql.cli;

import com.beust.jcommander.JCommander;
import io.github.utplsql.api.types.CustomTypes;
import io.github.utplsql.api.CustomTypes;
import org.junit.Assert;
import org.junit.Test;

Expand Down Expand Up @@ -38,7 +38,7 @@ public void reporterOptions_Default() {

@Test
public void reporterOptions_OneReporter() {
RunCommand runCmd = createCommand("run", "app/app@docker/xe", "-f=ut_documentation_reporter", "-o=output.txt");
RunCommand runCmd = createCommand("run", "app/app", "-f=ut_documentation_reporter", "-o=output.txt");

List<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();

Expand All @@ -51,7 +51,7 @@ public void reporterOptions_OneReporter() {

@Test
public void reporterOptions_OneReporterForceScreen() {
RunCommand runCmd = createCommand("run", "app/app@docker/xe", "-f=ut_documentation_reporter", "-o=output.txt", "-s");
RunCommand runCmd = createCommand("run", "app/app", "-f=ut_documentation_reporter", "-o=output.txt", "-s");

List<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();

Expand All @@ -64,7 +64,7 @@ public void reporterOptions_OneReporterForceScreen() {

@Test
public void reporterOptions_OneReporterForceScreenInverse() {
RunCommand runCmd = createCommand("run", "app/app@docker/xe", "-f=ut_documentation_reporter", "-s", "-o=output.txt");
RunCommand runCmd = createCommand("run", "app/app", "-f=ut_documentation_reporter", "-s", "-o=output.txt");

List<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();

Expand All @@ -77,7 +77,7 @@ public void reporterOptions_OneReporterForceScreenInverse() {

@Test
public void reporterOptions_TwoReporters() {
RunCommand runCmd = createCommand("run", "app/app@docker/xe",
RunCommand runCmd = createCommand("run", "app/app",
"-f=ut_documentation_reporter",
"-f=ut_coverage_html_reporter", "-o=coverage.html", "-s");

Expand Down