Document how to run the DMaaP simulator locally 61/122761/1
authorliamfallon <liam.fallon@est.tech>
Tue, 20 Jul 2021 15:34:59 +0000 (16:34 +0100)
committerliamfallon <liam.fallon@est.tech>
Tue, 20 Jul 2021 15:35:02 +0000 (16:35 +0100)
Issue-ID: POLICY-3424
Change-Id: Iee6b3dd3cb0cb9aca28846e596286c287d8b645f
Signed-off-by: liamfallon <liam.fallon@est.tech>
docs/development/devtools/devtools.rst

index 7eb5e06..fac06ac 100644 (file)
@@ -332,3 +332,47 @@ of such a test case.
 See `this unit test case <https://github.com/onap/policy-clamp/blob/master/runtime/src/test/java/org/onap/policy/clamp/clds/it/HttpsItCase.java>`_
 for the full example.
 
+Running the DMaaP Simulator during Development
+**********************************************
+It is sometimes convenient to run the DMaaP simulator during development. You can run it from the command line using Maven or from within your IDE.
+
+Running on the Command Line
++++++++++++++++++++++++++++
+1. Check out the policy models repository
+2. Go to the *models-sim/policy-models-simulators* subdirectory in the policy-models repo
+3. Run the following Maven command:
+
+   .. code-block:: bash
+
+      mvn exec:java  -Dexec.mainClass=org.onap.policy.models.simulators.Main -Dexec.args="src/test/resources/simParameters.json"
+
+Running in Eclipse
+++++++++++++++++++
+1. Check out the policy models repository
+2. Go to the *models-sim/policy-models-simulators* module in the policy-models repo
+3. Specify a run configuration using the class *org.onap.policy.models.simulators.Main* as the main class
+4. Specify an argument of *src/test/resources/simParameters.json* to the run configuration
+5. Run the configuration
+
+Specifying a local configuration file
++++++++++++++++++++++++++++++++++++++
+
+You may specify a local configuration file instead of *src/test/resources/simParameters.json* on the command line or as an arument in the run configuration in eclipse:
+
+.. code-block:: json
+
+   {
+     "dmaapProvider": {
+       "name": "DMaaP simulator",
+       "topicSweepSec": 900
+     },
+     "restServers": [
+       {
+         "name": "DMaaP simulator",
+         "providerClass": "org.onap.policy.models.sim.dmaap.rest.DmaapSimRestControllerV1",
+         "host": "localhost",
+         "port": 3904,
+         "https": false
+       }
+     ]
+   }