2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.dmaap.mr.logging;
23 import static org.junit.Assert.assertTrue;
25 import java.util.concurrent.TimeUnit;
27 import org.junit.After;
28 import org.junit.Before;
29 import org.junit.Test;
31 import org.onap.dmaap.mr.client.HostSelector;
33 public class MRAppenderTest {
34 private MRAppender appender = null;
37 public void setUp() throws Exception {
38 appender = new MRAppender();
43 public void tearDown() throws Exception {
48 public void testClose() {
51 } catch (NullPointerException e) {
60 public void testRequiresLayout() {
62 appender.requiresLayout();
68 public void testAppend() {
71 appender.append(null);
72 } catch (NullPointerException e) {
81 public void testActivateOptions() {
83 appender.activateOptions();
89 public void testGetTopic() {
97 public void testSetTopic() {
99 appender.setTopic("testTopic");
105 public void testGetPartition() {
107 appender.getPartition();
113 public void testSetPartition() {
115 appender.setPartition("partition");
121 public void testGetHosts() {
129 public void testSetHosts() {
131 appender.setHosts("hosts");
137 public void testGetMaxBatchSize() {
139 appender.getMaxBatchSize();
145 public void testSetMaxBatchSize() {
147 appender.setMaxBatchSize(20);
153 public void testGetMaxAgeMs() {
155 appender.getMaxAgeMs();
161 public void testSetMaxAgeMs() {
163 appender.setMaxAgeMs(15);
169 public void testIsCompress() {
171 appender.isCompress();
177 public void testSetCompress() {
179 appender.setCompress(true);