From aa148d9b5bba6ad23736e939a6d0ec917e761e1e Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 31 Jul 2019 09:45:27 -0400 Subject: Flesh out DMaaP simulator Fleshed out the dmaap simulator with additional media types. Added more junit tests. Added buildDmaapSim() to simulators Util. Change-Id: I39acd3df8e8d0ded21228e56fa1ef919cafc3772 Issue-ID: POLICY-2144 Signed-off-by: Jim Hahn --- models-sim/models-sim-dmaap/pom.xml | 12 + .../policy/models/sim/dmaap/DmaapSimConstants.java | 32 --- .../dmaap/parameters/DmaapSimParameterGroup.java | 11 +- .../dmaap/parameters/DmaapSimParameterHandler.java | 5 +- .../sim/dmaap/parameters/RestServerParameters.java | 6 +- .../sim/dmaap/provider/ConsumerGroupData.java | 190 +++++++++++++ .../sim/dmaap/provider/DmaapSimProvider.java | 215 +++++++-------- .../models/sim/dmaap/provider/TopicData.java | 201 ++++++++++++++ .../sim/dmaap/rest/CambriaMessageBodyHandler.java | 170 ++++++++++-- .../sim/dmaap/rest/DmaapSimRestControllerV1.java | 76 ++--- .../models/sim/dmaap/rest/DmaapSimRestServer.java | 100 ++----- .../sim/dmaap/rest/JsonMessageBodyHandler.java | 63 ----- .../sim/dmaap/rest/TextMessageBodyHandler.java | 66 +++++ .../sim/dmaap/startstop/DmaapSimActivator.java | 25 +- .../startstop/DmaapSimCommandLineArguments.java | 40 +-- .../policy/models/sim/dmaap/startstop/Main.java | 13 +- .../src/main/resources/etc/DefaultConfig.json | 1 + .../models/sim/dmaap/DmaapSimXxxExceptionTest.java | 39 +++ .../sim/dmaap/provider/ConsumerGroupDataTest.java | 305 +++++++++++++++++++++ .../sim/dmaap/provider/DmaapSimProviderTest.java | 287 +++++++++++++++++++ .../models/sim/dmaap/provider/TopicDataTest.java | 213 ++++++++++++++ .../sim/dmaap/rest/BaseRestControllerV1Test.java | 63 +++++ .../dmaap/rest/CambriaMessageBodyHandlerTest.java | 145 ++++++++++ .../models/sim/dmaap/rest/CommonRestServer.java | 181 ++++++++++++ .../dmaap/rest/DmaapSimRestControllerV1Test.java | 94 +++++++ .../sim/dmaap/rest/TextMessageBodyHandlerTest.java | 81 ++++++ .../onap/policy/sim/dmaap/e2e/EndToEndTest.java | 199 ++++++++++++++ .../sim/dmaap/parameters/CommonTestData.java | 89 ++++++ .../parameters/DmaapSimParameterGroupTest.java | 34 +++ .../parameters/DmaapSimParameterHandlerTest.java | 70 +++++ .../sim/dmaap/startstop/DmaapSimActivatorTest.java | 95 +++++++ .../onap/policy/sim/dmaap/startstop/MainTest.java | 100 +++++++ .../resources/parameters/EmptyParameterFile.json | 0 .../resources/parameters/MinimumParameters.json | 3 +- .../resources/parameters/NormalParameters.json | 1 + .../parameters/Parameters_InvalidName.json | 1 + .../test/resources/parameters/TopicParameters.json | 36 +++ 37 files changed, 2826 insertions(+), 436 deletions(-) delete mode 100644 models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/DmaapSimConstants.java create mode 100644 models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/provider/ConsumerGroupData.java create mode 100644 models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/provider/TopicData.java delete mode 100644 models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/rest/JsonMessageBodyHandler.java create mode 100644 models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/rest/TextMessageBodyHandler.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/DmaapSimXxxExceptionTest.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/provider/ConsumerGroupDataTest.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/provider/DmaapSimProviderTest.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/provider/TopicDataTest.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/rest/BaseRestControllerV1Test.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/rest/CambriaMessageBodyHandlerTest.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/rest/CommonRestServer.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/rest/DmaapSimRestControllerV1Test.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/models/sim/dmaap/rest/TextMessageBodyHandlerTest.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/e2e/EndToEndTest.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/parameters/CommonTestData.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/parameters/DmaapSimParameterGroupTest.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/parameters/DmaapSimParameterHandlerTest.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/startstop/DmaapSimActivatorTest.java create mode 100644 models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/startstop/MainTest.java create mode 100644 models-sim/models-sim-dmaap/src/test/resources/parameters/EmptyParameterFile.json create mode 100644 models-sim/models-sim-dmaap/src/test/resources/parameters/TopicParameters.json (limited to 'models-sim/models-sim-dmaap') diff --git a/models-sim/models-sim-dmaap/pom.xml b/models-sim/models-sim-dmaap/pom.xml index c1981e6be..e3f0f0b27 100644 --- a/models-sim/models-sim-dmaap/pom.xml +++ b/models-sim/models-sim-dmaap/pom.xml @@ -1,6 +1,7 @@