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;
26 import org.junit.After;
27 import org.junit.Before;
28 import org.junit.Test;
30 public class MRAppenderTest {
31 private MRAppender appender = null;
34 public void setUp() throws Exception {
35 appender = new MRAppender();
40 public void tearDown() throws Exception {
45 public void testClose() {
48 } catch (NullPointerException e) {
57 public void testRequiresLayout() {
59 appender.requiresLayout();
65 public void testAppend() {
68 appender.append(null);
69 } catch (NullPointerException e) {
78 public void testActivateOptions() {
80 appender.activateOptions();
86 public void testGetTopic() {
94 public void testSetTopic() {
96 appender.setTopic("testTopic");
102 public void testGetPartition() {
104 appender.getPartition();
110 public void testSetPartition() {
112 appender.setPartition("partition");
118 public void testGetHosts() {
126 public void testSetHosts() {
128 appender.setHosts("hosts");
134 public void testGetMaxBatchSize() {
136 appender.getMaxBatchSize();
142 public void testSetMaxBatchSize() {
144 appender.setMaxBatchSize(20);
150 public void testGetMaxAgeMs() {
152 appender.getMaxAgeMs();
158 public void testSetMaxAgeMs() {
160 appender.setMaxAgeMs(15);
166 public void testIsCompress() {
168 appender.isCompress();
174 public void testSetCompress() {
176 appender.setCompress(true);