Sign inSign up

parasoft/demo-app

By parasoft

Updated 2 days ago

Parasoft demo application

Image
1

3.9K

parasoft/demo-app repository overview

Quick reference

What is Parasoft Demo Application?

Parasoft Demo Application is an example Spring Boot project. The application is configurable and customizable, and is used to demonstrate functionality in a variety of Parasoft tools.

How to use this image

To run the image:

$ docker run -d -p 8080:8080 -p 9001:9001 -p 50051:50051 -p 61623:61623 -p 61624:61624 -p 61626:61626 parasoft/demo-app
  • 61623 - for STOMP (ActiveMQ) messaging
  • 61624 - for WebSocket (ActiveMQ) messaging

    Note: you can skip the following ports if you don't plan to directly connect to the following endpoints:
  • 9001 - Parasoft Demo Application embedded HSQLDB server
  • 50051 - gRPC Service endpoint
  • 61626 - Inventory Service JMS service endpoint

Injecting Jtest coverage agent into Parasoft Demo Application Docker image

1. Locate the Jtest monitor directory containing Jtest agent jar and configuration files.

For details how to create the monitor directory and Jtest integration with Tomcat, see Web Application Coverage Tutorial section of the Jtest docs.

This example will use a Windows path C:\jtest\monitor for the monitor directory.

2. Run Parasoft Demo Application container with the following options:

docker run -p 8080:8080 -p 8050:8050 -p 61623:61623 -p 61624:61624 -e CATALINA_OPTS=-javaagent:"/home/docker/jtest/monitor/agent.jar"=settings="/home/docker/jtest/monitor/agent.properties",runtimeData="/home/docker/jtest/monitor/runtime_coverage" -v C:\jtest\monitor:/home/docker/jtest/monitor parasoft/demo-app

Port 8050 is optional and can be used to check the Jtest agent status at http://your-parabank-host:8050/status

C:\jtest\monitor is a Jtest monitor directory on your local machine, /home/docker/jtest/monitor is a directory in the container that is mapped to the C:\jtest\monitor directory on your local machine. You can replace the /home/docker/jtest/monitor path with a valid path of your choice.

Alternatively you can put the CATALINA_OPTS property in a file and use Docker run --env-file option instead:

docker run -p 8080:8080 -p 8050:8050 -p 61623:61623 -p 61624:61624 --env-file my-env.txt -v C:\jtest\monitor:/home/docker/jtest/monitor parasoft/demo-app

Or you can set CATALINA_OPTS environment variable in the console you use to run docker and pass only the variable name to the -e option of the docker run command:

docker run -p 8080:8080 -p 8050:8050 -p 61623:61623 -p 61624:61624 -e CATALINA_OPTS -v C:\jtest\monitor:/home/docker/jtest/monitor parasoft/demo-app

3. Inspect the C:\jtest\monitor directory on your machine. A runtime_coverage folder should contain coverage data.

Injecting Virtualize JDBC driver into Parasoft Demo Application

1. Create a working directory (<VIRT_JDBC_DIR>) and a lib folder in it.

2. Copy <VIRTUALIZE_INSTALL_DIR>/proxies/ParasoftJDBCDriver.jar to the <VIRT_JDBC_DIR>/lib folder.

3. Open Parasoft Virtualize and start the Server.

4. Run Parasoft Demo Application container.

In the command line below, replace <VIRT_JDBC_DIR> with the absolute path of the folder you created in step 1. Alternatively, instead of specifying the absolute path you can use %cd% (Windows) or ${PWD} (Linux) shortcut to get the absolute path of the current directory, such as %cd%\ParasoftJDBCDriver.jar or ${PWD}/ParasoftJDBCDriver.jar.

docker run -d -w /usr/local/tomcat/data -v "<VIRT_JDBC_DIR>:/usr/local/tomcat/data" -v "<VIRT_JDBC_DIR>\lib\ParasoftJDBCDriver.jar:/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/ParasoftJDBCDriver.jar" -p 8080:8080 -p 9001:9001 -p 61623:61623 -p 61624:61624 parasoft/demo-app

5. Verify the JDBC Controller.

5.1. Open the Demo Administration page. Set configuration in "PARASOFT JDBC PROXY" section and save changes. For "Parasoft Virtualize server URL", use the IP address where your Virtualize Server is running or use host.docker.internal as Docker replacement for localhost if your Virtualize Server is running on the same Docker host.

5.2. Refresh the Virtualize Server. A JDBC Controller with the same name as Parasoft Virtualize group ID should appear in the Server tree view.

Using Keycloak in docker with Parasoft Demo Application in docker

1. Download docker-compose.yaml from Github. Create a folder (if it does not exist) under the same directory with name keycloak.

2. Download demo-app-realm.json from Github and put it in keycloak folder.

3. Use docker compose to start the Parasoft Demo Application container and Keycloak container.

docker-compose --profile keycloak up -d

The default hostname that is configured in the Dockerfile is 'host.docker.internal'. Please use the following command if the hostname of Keycloak has been configured differently. 

EXTERNAL_HOSTNAME=<hostname> docker-compose --profile keycloak up -d

Using external Keycloak server with Parasoft Demo Application in docker

1. Download demo-app-realm.json from Github. Import realm and start Keycloak in development mode.

2. Create a working directory (<WORKING_DIR>). Run Parasoft Demo Application container with:

docker run -d -w /usr/local/tomcat/data -v "<WORKING_DIR>:/usr/local/tomcat/data" -e JAVA_OPTS=-Dspring.security.oauth2.client.provider.keycloak.realm-uri=http://<keycloak.host>:<keycloak.port>/realms/demo-app-realm -p 8080:8080 -p 61623:61623 -p 61624:61624 parasoft/demo-app

Using Kafka in docker with Parasoft Demo Application in docker

1. Download docker-compose.yaml from Github.

2. Use docker compose to start the Parasoft Demo Application container and Kafka container.

docker-compose --profile kafka up -d

Using external Kafka server with Parasoft Demo Application in docker

1. Locate the home directory of external Kafka server. Change the following properties for network setup in /config/server.properties file:

listeners=PLAINTEXT://:19092
advertised.listeners=PLAINTEXT://:19092

2. Create a working directory (<WORKING_DIR>) and a config folder in it. Create application.properties under the config folder for customized configurations with following properties:

spring.kafka.bootstrap-servers=<Kafka broker address> # e.g. use "host.docker.internal:19092" for Kafka on localhost

3. Run Parasoft Demo Application container.

docker run -d -w /usr/local/tomcat/data -v "<WORKING_DIR>:/usr/local/tomcat/data" -p 8080:8080 -p 61623:61623 -p 61624:61624 parasoft/demo-app

Using RabbitMQ in docker with Parasoft Demo Application in docker

1. Download docker-compose.yaml from Github.

2. Use docker compose to start the Parasoft Demo Application container and RabbitMQ container.

docker-compose --profile rabbitmq up -d

Using external RabbitMQ server with Parasoft Demo Application in docker

1. Create a working directory (<WORKING_DIR>) and a config folder in it. Create application.properties under the config folder for customized configurations with following properties:

spring.rabbitmq.host=<RabbitMQ host> # e.g. use "host.docker.internal" for RabbitMQ on localhost
spring.rabbitmq.username=<Login user to authenticate to the broker> # make sure the user has "administrator" tag to support remote connection
spring.rabbitmq.password=<Login to authenticate against the broker>

2. Run Parasoft Demo Application container.

docker run -d -w /usr/local/tomcat/data -v "<WORKING_DIR>:/usr/local/tomcat/data" -p 8080:8080 -p 61623:61623 -p 61624:61624 parasoft/demo-app

Tag summary

Content type

Image

Digest

sha256:e109b973f

Size

373.8 MB

Last updated

2 days ago

docker pull parasoft/demo-app