diff options
author | an4828 <nekrassov@att.com> | 2017-09-26 14:35:17 -0400 |
---|---|---|
committer | an4828 <nekrassov@att.com> | 2017-09-26 14:35:24 -0400 |
commit | 06044df56fb07f4b368888581752855595e7b147 (patch) | |
tree | 6400a3a6ede762887861a621b7fdbfadd25190d5 /dcae-analytics-dmaap/src/test/java/org/openecomp/dcae/apod/analytics/dmaap/it/BaseAnalyticsDMaaPIT.java | |
parent | 475cb8c867038acd73ff540173d54bac3947c610 (diff) |
TCA: Support for VES/A&AI enrichment
Change-Id: I75e0f8e034b9334e918304739e4d73dd12c1ff62
Signed-off-by: an4828 <nekrassov@att.com>
Issue-ID: DCAEGEN2-116
Diffstat (limited to 'dcae-analytics-dmaap/src/test/java/org/openecomp/dcae/apod/analytics/dmaap/it/BaseAnalyticsDMaaPIT.java')
-rw-r--r-- | dcae-analytics-dmaap/src/test/java/org/openecomp/dcae/apod/analytics/dmaap/it/BaseAnalyticsDMaaPIT.java | 218 |
1 files changed, 109 insertions, 109 deletions
diff --git a/dcae-analytics-dmaap/src/test/java/org/openecomp/dcae/apod/analytics/dmaap/it/BaseAnalyticsDMaaPIT.java b/dcae-analytics-dmaap/src/test/java/org/openecomp/dcae/apod/analytics/dmaap/it/BaseAnalyticsDMaaPIT.java index 036e8ca..840d356 100644 --- a/dcae-analytics-dmaap/src/test/java/org/openecomp/dcae/apod/analytics/dmaap/it/BaseAnalyticsDMaaPIT.java +++ b/dcae-analytics-dmaap/src/test/java/org/openecomp/dcae/apod/analytics/dmaap/it/BaseAnalyticsDMaaPIT.java @@ -1,109 +1,109 @@ -/* - * ===============================LICENSE_START====================================== - * dcae-analytics - * ================================================================================ - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * 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=========================================== - */ - -package org.openecomp.dcae.apod.analytics.dmaap.it; - -import org.openecomp.dcae.apod.analytics.dmaap.domain.config.DMaaPMRPublisherConfig; -import org.openecomp.dcae.apod.analytics.dmaap.domain.config.DMaaPMRSubscriberConfig; -import org.openecomp.dcae.apod.analytics.dmaap.domain.response.DMaaPMRPublisherResponse; -import org.openecomp.dcae.apod.analytics.dmaap.service.publisher.DMaaPMRPublisher; -import org.openecomp.dcae.apod.analytics.test.BaseDCAEAnalyticsIT; - -import java.util.List; - -import static com.google.common.collect.ImmutableList.of; - -/** - * Base class for all DCAE DMaaP Integration Tests - * <p> - * @author Rajiv Singla . Creation Date: 10/13/2016. - */ -public abstract class BaseAnalyticsDMaaPIT extends BaseDCAEAnalyticsIT { - - // Integration Test Settings - protected static final String HOST_NAME = "mrlocal-mtnjftle01.homer.com"; - protected static final Integer PORT_NUMBER = 3905; - protected static final String TOPIC_NAME = "com.dcae.dmaap.mtnje2.DcaeTestVESPub"; - - protected static final String USERNAME = "USER"; - protected static final String PASSWORD = "PASSWORD"; - protected static final String HTTP_PROTOCOL = "https"; - protected static final String CONTENT_TYPE = "application/json"; - - protected static final int PUBLISHER_MAX_BATCH_QUEUE_SIZE = 20; - protected static final int PUBLISHER_MAX_RECOVERY_QUEUE_SIZE = 200; - - protected static final String SUBSCRIBER_CONSUMER_ID = "123"; - protected static final String SUBSCRIBER_CONSUMER_GROUP_NAME = "testGonsumerName-" + SUBSCRIBER_CONSUMER_ID; - protected static final int SUBSCRIBER_TIMEOUT_MS = 2000; - protected static final int SUBSCRIBER_MESSAGE_LIMIT = 20; - - /** - * Creates Sample Publisher settings for integration testing purposes - * - * @return DMaaP MR Publisher Config - */ - protected static DMaaPMRPublisherConfig getPublisherConfig() { - return new DMaaPMRPublisherConfig.Builder(HOST_NAME, TOPIC_NAME) - .setPortNumber(PORT_NUMBER) - .setProtocol(HTTP_PROTOCOL) - .setContentType(CONTENT_TYPE) - .setUserName(USERNAME) - .setUserPassword(PASSWORD) - .setMaxBatchSize(PUBLISHER_MAX_BATCH_QUEUE_SIZE) - .setMaxRecoveryQueueSize(PUBLISHER_MAX_RECOVERY_QUEUE_SIZE) - .build(); - } - - /** - * Creates Sample Subscriber settings for integration testing purposes - * - * @return DMaaP MR Subscriber Config - */ - protected static DMaaPMRSubscriberConfig getSubscriberConfig(String consumerId) { - return new DMaaPMRSubscriberConfig.Builder(HOST_NAME, TOPIC_NAME) - .setPortNumber(PORT_NUMBER) - .setProtocol(HTTP_PROTOCOL) - .setContentType(CONTENT_TYPE) - .setUserName(USERNAME) - .setUserPassword(PASSWORD) - .setConsumerGroup(SUBSCRIBER_CONSUMER_GROUP_NAME) - .setConsumerId(consumerId != null ? consumerId : SUBSCRIBER_CONSUMER_ID) - .setTimeoutMS(SUBSCRIBER_TIMEOUT_MS) - .setMessageLimit(SUBSCRIBER_MESSAGE_LIMIT).build(); - } - - /** - * Publishes 2 sample message to DMaaP Topic for integration test purposes - * - * @param dMaaPMRPublisher DMaaP MR Publisher - * @return DMaaP MR Publisher Response - */ - protected static DMaaPMRPublisherResponse publishTwoSampleMessages(DMaaPMRPublisher dMaaPMRPublisher) { - return dMaaPMRPublisher.publish(getTwoSampleMessage()); - } - - protected static List<String> getTwoSampleMessage() { - String message1 = "{ \"message\" : \"Test Message1\"}"; - String message2 = "{ \"message\" : \"Test Message2\"}"; - return of(message1, message2); - } - -} +/*
+ * ===============================LICENSE_START======================================
+ * dcae-analytics
+ * ================================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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===========================================
+ */
+
+package org.openecomp.dcae.apod.analytics.dmaap.it;
+
+import org.openecomp.dcae.apod.analytics.dmaap.domain.config.DMaaPMRPublisherConfig;
+import org.openecomp.dcae.apod.analytics.dmaap.domain.config.DMaaPMRSubscriberConfig;
+import org.openecomp.dcae.apod.analytics.dmaap.domain.response.DMaaPMRPublisherResponse;
+import org.openecomp.dcae.apod.analytics.dmaap.service.publisher.DMaaPMRPublisher;
+import org.openecomp.dcae.apod.analytics.test.BaseDCAEAnalyticsIT;
+
+import java.util.List;
+
+import static com.google.common.collect.ImmutableList.of;
+
+/**
+ * Base class for all DCAE DMaaP Integration Tests
+ * <p>
+ * @author Rajiv Singla . Creation Date: 10/13/2016.
+ */
+public abstract class BaseAnalyticsDMaaPIT extends BaseDCAEAnalyticsIT {
+
+ // Integration Test Settings
+ protected static final String HOST_NAME = "mrlocal-mtnjftle01.homer.com";
+ protected static final Integer PORT_NUMBER = 3905;
+ protected static final String TOPIC_NAME = "com.dcae.dmaap.mtnje2.DcaeTestVESPub";
+
+ protected static final String USERNAME = "USER";
+ protected static final String PASSWORD = "PASSWORD";
+ protected static final String HTTP_PROTOCOL = "https";
+ protected static final String CONTENT_TYPE = "application/json";
+
+ protected static final int PUBLISHER_MAX_BATCH_QUEUE_SIZE = 20;
+ protected static final int PUBLISHER_MAX_RECOVERY_QUEUE_SIZE = 200;
+
+ protected static final String SUBSCRIBER_CONSUMER_ID = "123";
+ protected static final String SUBSCRIBER_CONSUMER_GROUP_NAME = "testGonsumerName-" + SUBSCRIBER_CONSUMER_ID;
+ protected static final int SUBSCRIBER_TIMEOUT_MS = 2000;
+ protected static final int SUBSCRIBER_MESSAGE_LIMIT = 20;
+
+ /**
+ * Creates Sample Publisher settings for integration testing purposes
+ *
+ * @return DMaaP MR Publisher Config
+ */
+ protected static DMaaPMRPublisherConfig getPublisherConfig() {
+ return new DMaaPMRPublisherConfig.Builder(HOST_NAME, TOPIC_NAME)
+ .setPortNumber(PORT_NUMBER)
+ .setProtocol(HTTP_PROTOCOL)
+ .setContentType(CONTENT_TYPE)
+ .setUserName(USERNAME)
+ .setUserPassword(PASSWORD)
+ .setMaxBatchSize(PUBLISHER_MAX_BATCH_QUEUE_SIZE)
+ .setMaxRecoveryQueueSize(PUBLISHER_MAX_RECOVERY_QUEUE_SIZE)
+ .build();
+ }
+
+ /**
+ * Creates Sample Subscriber settings for integration testing purposes
+ *
+ * @return DMaaP MR Subscriber Config
+ */
+ protected static DMaaPMRSubscriberConfig getSubscriberConfig(String consumerId) {
+ return new DMaaPMRSubscriberConfig.Builder(HOST_NAME, TOPIC_NAME)
+ .setPortNumber(PORT_NUMBER)
+ .setProtocol(HTTP_PROTOCOL)
+ .setContentType(CONTENT_TYPE)
+ .setUserName(USERNAME)
+ .setUserPassword(PASSWORD)
+ .setConsumerGroup(SUBSCRIBER_CONSUMER_GROUP_NAME)
+ .setConsumerId(consumerId != null ? consumerId : SUBSCRIBER_CONSUMER_ID)
+ .setTimeoutMS(SUBSCRIBER_TIMEOUT_MS)
+ .setMessageLimit(SUBSCRIBER_MESSAGE_LIMIT).build();
+ }
+
+ /**
+ * Publishes 2 sample message to DMaaP Topic for integration test purposes
+ *
+ * @param dMaaPMRPublisher DMaaP MR Publisher
+ * @return DMaaP MR Publisher Response
+ */
+ protected static DMaaPMRPublisherResponse publishTwoSampleMessages(DMaaPMRPublisher dMaaPMRPublisher) {
+ return dMaaPMRPublisher.publish(getTwoSampleMessage());
+ }
+
+ protected static List<String> getTwoSampleMessage() {
+ String message1 = "{ \"message\" : \"Test Message1\"}";
+ String message2 = "{ \"message\" : \"Test Message2\"}";
+ return of(message1, message2);
+ }
+
+}
|