In this section:
Overview
The Parasoft gRPC Transport Extension adds support for the Google Remote Procedure Call transport to applicable messaging client tools in SOAtest. This enables you to take full advantage of SOAtest's rich interface when configuring, sending, and validating messages sent over gRPC.
Requirements
- gRPC 1.0.0 or later
- Parasoft SOAtest 2020.1 or later
Installation
This artifact can be installed from the UI or the command line.
UI Installation
- Go to Parasoft > Preferences.
- Select System Properties and click Add JARs.
- In the file chooser that opens, navigate to and select com.parasoft.soavirt.transport.grpc-<version>.jar.
- Click Apply and restart SOAtest.
Command Line Installation
Add the com.parasoft.soavirt.transport.grpc-<version>.jar file to the system.properties.classpath property in your settings properties file. For example:
system.properties.classpath=<path to jar>/com.parasoft.soavirt.transport.grpc-<version>.jar
Usage
You can configure message client tools (for example, Messaging Client and ProtoBuf Client) to use the gRPC Transport by enabling it in the tool's Transport tab. Choose gRPC from the Transport drop-down menu and configure the available options.
If your system has more than one custom extension, choose gRPC from the Select implementation drop-down menu.
Configuration
There are five groups of settings to configure: Connection, Streaming, Logging, and Connection Management. Each group is described below.
Connection Settings
Host | Specify the host name for the gRPC server. |
---|---|
Port | Specify the port on the host specified above. Value must be between |
Service Name | Specify the name of the gRPC service to call. |
Method Name | Specify the name of the gRPC method to call. |
Streaming Settings
Call ID | Enter the call ID used to switch between multiple open gRPC calls. Default = <default> |
---|---|
Mode | Specify the streaming mode. Options are:
Default = |
Notification | Specify a notification type. Options are:
Default = |
Transport Layer Security Settings
Auth Mechanism | Specify the authorization mechanism you want to use to connect to the gRPC server. Options are |
---|---|
Trust Certificate File | Specify the path to a certificate file in PEM format that identifies the gRPC server. This is required for gRPC servers with self-signed certificates. Leave this field blank to use the system trust store for gRPC servers with a public certificate from a root authority. This field is ignored when the Auth Mechanism is set to |
Logging Settings
Log Level | Specify how much information you want logged to the console. The default is 2 (warn). |
---|
Connection Management Settings
Keep connection alive | Enable this option to keep the gRPC channel alive and reused for subsequent calls. |
---|---|
Close connection after test execution | Enable this option to shutdown the gRPC channel after all calls have completed. |
Testing Different gRPC Methods
A gRPC method may operate as one of four types:
- Unary
- Server streaming
- Client streaming
- Bidirectional streaming
SOAtest uses a single messaging client (or ProtoBuf client) to test a unary gRPC method. The client request is sent to the method on the gRPC server and then the test waits for a response message or an error. This is the default mode in the gRPC custom transport.
Multiple messaging clients (or Protobuf clients) are needed to test the other three gRPC method types for streaming. In each case the client requests and server responses are decoupled. Tools that are configured to send will not have any response payload and tools that are configured to receive will ignore the request payload. It is also necessary to send the completed notification from SOAtest after sending requests, even for server streaming method types that only take one request message. A tool configured to receive the completed notification will wait for that event or report an error if another response message is received. This allows SOAtest to consume a dynamic number of response messages from a gRPC stream by checking if the stream has completed inside of a looping test suite.
Third-party Content
This extension includes items that have been sourced from third parties as outlined below.
- gRPC (Apache License 2.0)
- PerfMark (Apache License 2.0)
- SLF4J (MIT License)
Additional license details are available in this plugin's licenses folder.