RecordingProcessManager class

Records process invocation activity and serializes it to disk.

A RecordingProcessManager decorates another ProcessManager instance by recording all process invocation activity (including the stdout and stderr of the associated processes) before delegating to the underlying manager.

This class enables "record / replay" tests, where you record the process invocation activity during a real program run, serialize the activity to disk, then fake all invocation activity during tests by replaying the serialized recording.

See also:

Implemented types

Constructors

RecordingProcessManager(ProcessManager delegate, Directory destination)
Constructs a new RecordingProcessManager. [...]

Properties

delegate ProcessManager
The manager to which this manager delegates.
final
destination Directory
The directory to which serialized invocation metadata will be written.
final
fs FileSystem
The file system in which this manager will create recording files.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

canRun(dynamic executable, { String workingDirectory }) bool
Returns true if the executable exists and if it can be executed.
override
flush({bool finishRunningProcesses: false, Duration timeout: const Duration(milliseconds: 20) }) Future<Null>
Flushes pending data to destination. [...]
killPid(int pid, [ ProcessSignal signal = io.ProcessSignal.sigterm ]) bool
Kills the process with id pid. [...]
override
run(List command, { String workingDirectory, Map<String, String> environment, bool includeParentEnvironment: true, bool runInShell: false, Encoding stdoutEncoding: io.systemEncoding, Encoding stderrEncoding: io.systemEncoding }) Future<ProcessResult>
Starts a process and runs it non-interactively to completion. [...]
override
runSync(List command, { String workingDirectory, Map<String, String> environment, bool includeParentEnvironment: true, bool runInShell: false, Encoding stdoutEncoding: io.systemEncoding, Encoding stderrEncoding: io.systemEncoding }) ProcessResult
Starts a process and runs it to completion. This is a synchronous call and will block until the child process terminates. [...]
override
start(List command, { String workingDirectory, Map<String, String> environment, bool includeParentEnvironment: true, bool runInShell: false, ProcessStartMode mode: io.ProcessStartMode.normal }) Future<Process>
Starts a process by running the specified command. [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited