ExecutableDifferenceReporter

public class ExecutableDifferenceReporter implements Reporter

A reporter that will shell out to an executable that is presented on the user’s machine to verify the test output. Note that the approval command and the difference commands can be the same.

  • approval command will be used for the first approval
  • the difference command will be used when there is already a verified file but it is not the same as the value from the user

Constructors

ExecutableDifferenceReporter

public ExecutableDifferenceReporter(String approvalCommand, String diffCommand)

Main constructor for the executable reporter.

Parameters:
  • approvalCommand – the approval command
  • diffCommand – the difference command

Methods

approveNew

public void approveNew(byte[] value, File approvalDestination, File fileForVerification)

buildApproveNewCommand

protected String[] buildApproveNewCommand(File approvalDestination, File fileForVerification)

buildCommandline

static List<String> buildCommandline(String... cmdParts)

buildNotTheSameCommand

protected String[] buildNotTheSameCommand(File fileForVerification, File fileForApproval)

canApprove

public boolean canApprove(File fileForApproval)

getApprovalCommand

protected String getApprovalCommand()

getDiffCommand

protected String getDiffCommand()

notTheSame

public void notTheSame(byte[] oldValue, File fileForVerification, byte[] newValue, File fileForApproval)

runProcess

public static Process runProcess(String... cmdParts)

Execute a command with the following arguments.

Parameters:
  • cmdParts – the command parts
Throws:
  • IOException – if there were any I/O errors
Returns:

the process for the command that was started

startProcess

Process startProcess(String... cmdParts)