diff options
Diffstat (limited to 'message-bus/src/test/resources')
11 files changed, 239 insertions, 0 deletions
diff --git a/message-bus/src/test/resources/META-INF/services/org.onap.policy.common.message.bus.features.NetLoggerFeatureApi b/message-bus/src/test/resources/META-INF/services/org.onap.policy.common.message.bus.features.NetLoggerFeatureApi new file mode 100644 index 00000000..7889cb8f --- /dev/null +++ b/message-bus/src/test/resources/META-INF/services/org.onap.policy.common.message.bus.features.NetLoggerFeatureApi @@ -0,0 +1 @@ +org.onap.policy.common.message.bus.utils.NetLoggerUtilTest$NetLoggerFeature
\ No newline at end of file diff --git a/message-bus/src/test/resources/logback-test.xml b/message-bus/src/test/resources/logback-test.xml new file mode 100644 index 00000000..ddf4f8bb --- /dev/null +++ b/message-bus/src/test/resources/logback-test.xml @@ -0,0 +1,42 @@ +<!-- + ============LICENSE_START======================================================= + ONAP + ================================================================================ + Copyright (C) 2024 Nordix Foundation. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> +<configuration> + + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> + <Pattern> + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}.%M\(%line\) - %msg%n + </Pattern> + </encoder> + </appender> + + <appender name="testAppender" class="org.onap.policy.common.message.bus.utils.NetLoggerUtilTest$TestAppender"/> + + <logger name="org.onap.policy.drools.http.server.test" level="INFO"/> + + <logger name="network" level="INFO"> + <appender-ref ref="testAppender"/> + </logger> + + <root level="WARN"> + <appender-ref ref="STDOUT"/> + </root> + +</configuration>
\ No newline at end of file diff --git a/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/TopicEndpointProxyTest.json b/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/TopicEndpointProxyTest.json new file mode 100644 index 00000000..5b2e712a --- /dev/null +++ b/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/TopicEndpointProxyTest.json @@ -0,0 +1,30 @@ +{ + "locked": false, + "alive": false, + "topicSources": [ + { + "servers": [ + "my-server" + ], + "topic": "noop-source", + "effectiveTopic": "noop-source", + "recentEvents": [], + "alive": false, + "locked": false, + "topicCommInfrastructure": "NOOP" + } + ], + "topicSinks": [ + { + "servers": [ + "my-server" + ], + "topic": "noop-sink", + "effectiveTopic": "noop-sink", + "recentEvents": [], + "alive": false, + "locked": false, + "topicCommInfrastructure": "NOOP" + } + ] +} diff --git a/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/BusTopicBaseTest.json b/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/BusTopicBaseTest.json new file mode 100644 index 00000000..462278a4 --- /dev/null +++ b/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/BusTopicBaseTest.json @@ -0,0 +1,14 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "effectiveTopic" : "my-effective-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowTracing": true, + "allowSelfSignedCerts" : true, + "topicCommInfrastructure" : "NOOP" +} diff --git a/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/InlineBusTopicSinkTest.json b/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/InlineBusTopicSinkTest.json new file mode 100644 index 00000000..1f2fb55f --- /dev/null +++ b/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/InlineBusTopicSinkTest.json @@ -0,0 +1,15 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "effectiveTopic" : "my-effective-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowTracing": true, + "allowSelfSignedCerts" : true, + "topicCommInfrastructure" : "NOOP", + "partitionKey" : "my-partition" +} diff --git a/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/SingleThreadedBusTopicSourceTest.json b/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/SingleThreadedBusTopicSourceTest.json new file mode 100644 index 00000000..305620c8 --- /dev/null +++ b/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/SingleThreadedBusTopicSourceTest.json @@ -0,0 +1,18 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "effectiveTopic" : "my-effective-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "useHttps" : true, + "allowTracing": true, + "allowSelfSignedCerts" : true, + "consumerGroup" : "my-cons-group", + "consumerInstance" : "my-cons-inst", + "fetchTimeout" : 101, + "fetchLimit" : 100, + "topicCommInfrastructure" : "NOOP" +} diff --git a/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/TopicBaseTest.json b/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/TopicBaseTest.json new file mode 100644 index 00000000..b72b4efd --- /dev/null +++ b/message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/TopicBaseTest.json @@ -0,0 +1,9 @@ +{ + "servers" : [ "svra", "svrb" ], + "topic" : "my-topic", + "effectiveTopic" : "my-topic", + "recentEvents" : [ ], + "alive" : false, + "locked" : false, + "topicCommInfrastructure" : "NOOP" +} diff --git a/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_all_params.json b/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_all_params.json new file mode 100644 index 00000000..89e464dd --- /dev/null +++ b/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_all_params.json @@ -0,0 +1,62 @@ +{ + "topicSources" : [ { + "topic" : "policy-pdp-pap1", + "servers" : [ "kafka2, kafka3" ], + "topicCommInfrastructure" : "kafka", + "effectiveTopic" : "my-effective-topic", + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "port": 123, + "useHttps" : true, + "allowTracing": true, + "allowSelfSignedCerts" : true, + "consumerGroup" : "consumer group", + "consumerInstance" : "consumer instance", + "fetchTimeout" : 15000, + "fetchLimit" : 100, + "userName": "username", + "password": "password", + "managed": true, + "environment": "environment1", + "aftEnvironment": "aftEnvironment1", + "partner": "partner1", + "latitude": "1234", + "longitude": "1234", + "partitionId": "partition_id", + "additionalProps": {"xyz":"xyz"}, + "clientName": "clientName1", + "hostname": "hostname1", + "basePath": "basePath1", + "serializationProvider": "serializationProvider1" + }], + "topicSinks" : [ { + "topic" : "policy-pdp-pap1", + "servers" : [ "kafka2, kafka3" ], + "topicCommInfrastructure" : "kafka", + "effectiveTopic" : "my-effective-topic", + "apiKey" : "my-api-key", + "apiSecret" : "my-api-secret", + "port": 123, + "useHttps" : true, + "allowTracing": true, + "allowSelfSignedCerts" : true, + "consumerGroup" : "consumer group", + "consumerInstance" : "consumer instance", + "fetchTimeout" : 15000, + "fetchLimit" : 100, + "userName": "username", + "password": "password", + "managed": true, + "environment": "environment1", + "aftEnvironment": "aftEnvironment1", + "partner": "partner1", + "latitude": "1234", + "longitude": "1234", + "partitionId": "partition_id", + "additionalProps": {"xyz":"xyz"}, + "clientName": "clientName1", + "hostname": "hostname1", + "basePath": "basePath1", + "serializationProvider": "serializationProvider1" + }] +}
\ No newline at end of file diff --git a/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_invalid.json b/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_invalid.json new file mode 100644 index 00000000..775b4886 --- /dev/null +++ b/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_invalid.json @@ -0,0 +1,6 @@ +{ + "topicSources" : [{ + "topic" : "ueb-source", + "servers" : ["my-server"] + }] +}
\ No newline at end of file diff --git a/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_missing_mandatory.json b/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_missing_mandatory.json new file mode 100644 index 00000000..216c11ec --- /dev/null +++ b/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_missing_mandatory.json @@ -0,0 +1,12 @@ +{ + "topicSources" : [ { + "topic" : "policy-pdp-pap1", + "servers" : [], + "topicCommInfrastructure" : "kafka" + }], + "topicSinks" : [ { + "topic" : "policy-pdp-pap2", + "servers" : [ "kafka1, kafka2" ], + "topicCommInfrastructure" : "kafka" + }] +}
\ No newline at end of file diff --git a/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_valid.json b/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_valid.json new file mode 100644 index 00000000..2603bfdc --- /dev/null +++ b/message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_valid.json @@ -0,0 +1,30 @@ +{ + "topicSources" : [ { + "topic" : "ueb-source", + "servers" : [ "my-server" ], + "topicCommInfrastructure" : "ueb" + },{ + "topic" : "policy-pdp-pap1", + "servers" : [ "kafka1, kafka2" ], + "topicCommInfrastructure" : "kafka" + },{ + "topic" : "policy-pdp-pap2", + "servers" : [ "kafka2, kafka3" ], + "topicCommInfrastructure" : "kafka" + }], + "topicSinks" : [ { + "topic" : "ueb-sink", + "servers" : [ "my-server" ], + "topicCommInfrastructure" : "ueb" + },{ + "topic" : "policy-pdp-pap2", + "servers" : [ "kafka1, kafka2" ], + "topicCommInfrastructure" : "kafka" + },{ + "topic" : "policy-pdp-pap3", + "servers" : [ "kafka2, kafka3" ], + "topicCommInfrastructure" : "kafka", + "effectiveTopic":"effectiveTopic1", + "allowSelfSignedCerts":true + }] +}
\ No newline at end of file |