From c064f5e9ea7e385ae8c730bb9e9fc5fdd45e25d6 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 13 Feb 2019 10:53:12 -0500 Subject: Add gson handler and tests Added JacksonHandler which provides jackson behavior in gson. Also added classes to facilitate testing of gson serializations. Added compareGson(xxx, Class). Removed trailing spaces from some files. Updated license dates. Replaced incorrect constant with ${xxx} in json test file. Fixed typo in test method name. Change-Id: If05b654d76a4ffc88646f03334be82b32506f28f Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn --- .../event/comm/TopicEndpointProxyTest.json | 74 ++++++++++++++++++++++ .../event/comm/bus/internal/BusTopicBaseTest.json | 12 ++++ .../comm/bus/internal/InlineBusTopicSinkTest.json | 13 ++++ .../bus/internal/InlineDmaapTopicSinkTest.json | 13 ++++ .../comm/bus/internal/InlineUebTopicSinkTest.json | 13 ++++ .../internal/SingleThreadedBusTopicSourceTest.json | 16 +++++ .../SingleThreadedDmaapTopicSourceTest.json | 16 +++++ .../internal/SingleThreadedUebTopicSourceTest.json | 16 +++++ .../event/comm/bus/internal/TopicBaseTest.json | 8 +++ .../http/server/internal/HttpServerTest.json | 7 ++ 10 files changed, 188 insertions(+) create mode 100644 policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.json create mode 100644 policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBaseTest.json create mode 100644 policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSinkTest.json create mode 100644 policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineDmaapTopicSinkTest.json create mode 100644 policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineUebTopicSinkTest.json create mode 100644 policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSourceTest.json create mode 100644 policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedDmaapTopicSourceTest.json create mode 100644 policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedUebTopicSourceTest.json create mode 100644 policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.json create mode 100644 policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/http/server/internal/HttpServerTest.json (limited to 'policy-endpoints/src/test/resources') diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.json new file mode 100644 index 00000000..11624af0 --- /dev/null +++ b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.json @@ -0,0 +1,74 @@ +{ + "locked" : false, + "alive" : false, + "topicSources" : [ { + "servers" : [ "my-server" ], + "topic" : "ueb-source", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : null, + "apiSecret" : null, + "useHttps" : true, + "allowSelfSignedCerts" : true, + "consumerGroup" : "${obj.topicSources[0].consumerGroup}", + "consumerInstance" : "${obj.topicSources[0].consumerInstance}", + "fetchTimeout" : 15000, + "fetchLimit" : 100, + "topicCommInfrastructure" : "UEB" + }, { + "servers" : [ "my-server" ], + "topic" : "dmaap-source", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowSelfSignedCerts" : true, + "consumerGroup" : "my-cons-group", + "consumerInstance" : "my-cons-inst", + "fetchTimeout" : 101, + "fetchLimit" : 100, + "topicCommInfrastructure" : "DMAAP" + }, { + "servers" : [ "my-server" ], + "topic" : "noop-source", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "topicCommInfrastructure" : "NOOP" + } ], + "topicSinks" : [ { + "servers" : [ "my-server" ], + "topic" : "ueb-sink", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : null, + "apiSecret" : null, + "useHttps" : true, + "allowSelfSignedCerts" : true, + "topicCommInfrastructure" : "UEB", + "partitionKey" : "${obj.topicSinks[0].partitionKey}" + }, { + "servers" : [ "my-server" ], + "topic" : "dmaap-sink", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowSelfSignedCerts" : true, + "topicCommInfrastructure" : "DMAAP", + "partitionKey" : "my-partition" + }, { + "servers" : [ "my-server" ], + "topic" : "noop-sink", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "topicCommInfrastructure" : "NOOP" + } ] +} diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBaseTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBaseTest.json new file mode 100644 index 00000000..49eafaf1 --- /dev/null +++ b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBaseTest.json @@ -0,0 +1,12 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowSelfSignedCerts" : true, + "topicCommInfrastructure" : "NOOP" +} diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSinkTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSinkTest.json new file mode 100644 index 00000000..98318751 --- /dev/null +++ b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSinkTest.json @@ -0,0 +1,13 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowSelfSignedCerts" : true, + "topicCommInfrastructure" : "NOOP", + "partitionKey" : "my-partition" +} diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineDmaapTopicSinkTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineDmaapTopicSinkTest.json new file mode 100644 index 00000000..a83f5c97 --- /dev/null +++ b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineDmaapTopicSinkTest.json @@ -0,0 +1,13 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowSelfSignedCerts" : true, + "topicCommInfrastructure" : "DMAAP", + "partitionKey" : "my-partition" +} diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineUebTopicSinkTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineUebTopicSinkTest.json new file mode 100644 index 00000000..4ec0c80f --- /dev/null +++ b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineUebTopicSinkTest.json @@ -0,0 +1,13 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowSelfSignedCerts" : true, + "topicCommInfrastructure" : "UEB", + "partitionKey" : "my-partition" +} diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSourceTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSourceTest.json new file mode 100644 index 00000000..4f880257 --- /dev/null +++ b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSourceTest.json @@ -0,0 +1,16 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowSelfSignedCerts" : true, + "consumerGroup" : "my-cons-group", + "consumerInstance" : "my-cons-inst", + "fetchTimeout" : 101, + "fetchLimit" : 100, + "topicCommInfrastructure" : "NOOP" +} diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedDmaapTopicSourceTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedDmaapTopicSourceTest.json new file mode 100644 index 00000000..82e4b3ff --- /dev/null +++ b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedDmaapTopicSourceTest.json @@ -0,0 +1,16 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowSelfSignedCerts" : true, + "consumerGroup" : "my-cons-group", + "consumerInstance" : "my-cons-inst", + "fetchTimeout" : 101, + "fetchLimit" : 100, + "topicCommInfrastructure" : "DMAAP" +} diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedUebTopicSourceTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedUebTopicSourceTest.json new file mode 100644 index 00000000..4eeacc6d --- /dev/null +++ b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedUebTopicSourceTest.json @@ -0,0 +1,16 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowSelfSignedCerts" : true, + "consumerGroup" : "my-cons-group", + "consumerInstance" : "my-cons-inst", + "fetchTimeout" : 101, + "fetchLimit" : 100, + "topicCommInfrastructure" : "UEB" +} diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.json new file mode 100644 index 00000000..7431854d --- /dev/null +++ b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.json @@ -0,0 +1,8 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "topicCommInfrastructure" : "NOOP" +} diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/http/server/internal/HttpServerTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/http/server/internal/HttpServerTest.json new file mode 100644 index 00000000..5f4a7a90 --- /dev/null +++ b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/http/server/internal/HttpServerTest.json @@ -0,0 +1,7 @@ +{ + "aaf": false, + "alive": false, + "host": "localhost", + "name": "echo", + "port": ${obj.port} +} -- cgit 1.2.3-korg