The test Command

Note: The information in this section is applicable for an app executable only.

Use the test command in Flogo to test your Flogo app.

Options Description and Example
-flows

SYNTAX:

./<executable_filename -test -flows

Lists all flows in the specified <executable_filename> app.

Example:

./MyTestApp -test -flows

where MyTestApp is the app executable.

-flowdata

SYNTAX:

./<executable_filename> -test -flowdata <flow-name>

Generates input fields data file for a given flow. The input test data is generated based on the Flow Inputs you provided when creating the flow (on the Input tab of Flow Inputs & Outputs).

Example:

./MyTestApp -test -flowdata TestFlow

where MyTestApp is the app executable and TestFlow is a flow within MyTestApp. A JSON file with the file name with format <app-name>_<flow-name>_input.json gets created. This file contains the generated input fields configured on the Input tab of the Flow Inputs & Outputs.

You can edit this file to set specific values for the input fields and use the file to test your flow using the -flowin option described below.

-flowin

SYNTAX:

./<executable_filename> -test -flowin <path-to-input-file>

Test flow against given test data contained in an input JSON file. This file must exist in the location that you specify in the command.

Example:

./MyTestApp -test -flowin /usr/TestFlow_input.json

where MyTestApp is the app binary and /usr/TestFlow_input.json is the path to the JSON file containing the input to the flow.

Note: You can also use the test configurations that were exported from Launch Configuration as the input file in this command.

-flowout

SYNTAX:

./<executable_filename> -test -flowin <path to test data file> -flowout <path-to-output-file-name>

Write flow output (if applicable) to the specified file. If a file with the specified name does not already exist in the specified location, Flogo creates the file. If you do not specify a file name, the output gets printed to the console.

Example:

./MyTestApp -test -flowin TestFlow_input.json -flowout TestFlow_output.json

where MyTestApp is the app executable, TestFlow_input.json is the file containing the input data to the flow and TestFlow_output.json is the path to the JSON file you specify to hold the output from the flow.