one more case added in DmaapClientUtilTest.java
[dmaap/messagerouter/dmaapclient.git] / src / test / java / com / att / nsa / mr / logging / MRAppenderTest.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP Policy Engine\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package com.att.nsa.mr.logging;\r
22 \r
23 import static org.junit.Assert.assertTrue;\r
24 \r
25 import java.util.concurrent.TimeUnit;\r
26 \r
27 import org.junit.After;\r
28 import org.junit.Before;\r
29 import org.junit.Test;\r
30 \r
31 import com.att.nsa.mr.client.HostSelector;\r
32 \r
33 public class MRAppenderTest {\r
34         private MRAppender appender = null;\r
35 \r
36         @Before\r
37         public void setUp() throws Exception {\r
38                 appender = new MRAppender();\r
39 \r
40         }\r
41 \r
42         @After\r
43         public void tearDown() throws Exception {\r
44 \r
45         }\r
46 \r
47         @Test\r
48         public void testClose() {\r
49                 try {\r
50                         appender.close();\r
51                 } catch (NullPointerException e) {\r
52                         assertTrue(true);\r
53                 }\r
54 \r
55                 assertTrue(true);\r
56 \r
57         }\r
58 \r
59         @Test\r
60         public void testRequiresLayout() {\r
61 \r
62                 appender.requiresLayout();\r
63                 assertTrue(true);\r
64 \r
65         }\r
66 \r
67         @Test\r
68         public void testAppend() {\r
69 \r
70                 try {\r
71                         appender.append(null);\r
72                 } catch (NullPointerException e) {\r
73                         assertTrue(true);\r
74                 }\r
75 \r
76                 assertTrue(true);\r
77 \r
78         }\r
79 \r
80         @Test\r
81         public void testActivateOptions() {\r
82 \r
83                 appender.activateOptions();\r
84                 assertTrue(true);\r
85 \r
86         }\r
87 \r
88         @Test\r
89         public void testGetTopic() {\r
90 \r
91                 appender.getTopic();\r
92                 assertTrue(true);\r
93 \r
94         }\r
95 \r
96         @Test\r
97         public void testSetTopic() {\r
98 \r
99                 appender.setTopic("testTopic");\r
100                 assertTrue(true);\r
101 \r
102         }\r
103 \r
104         @Test\r
105         public void testGetPartition() {\r
106 \r
107                 appender.getPartition();\r
108                 assertTrue(true);\r
109 \r
110         }\r
111 \r
112         @Test\r
113         public void testSetPartition() {\r
114 \r
115                 appender.setPartition("partition");\r
116                 assertTrue(true);\r
117 \r
118         }\r
119 \r
120         @Test\r
121         public void testGetHosts() {\r
122 \r
123                 appender.getHosts();\r
124                 assertTrue(true);\r
125 \r
126         }\r
127 \r
128         @Test\r
129         public void testSetHosts() {\r
130 \r
131                 appender.setHosts("hosts");\r
132                 assertTrue(true);\r
133 \r
134         }\r
135 \r
136         @Test\r
137         public void testGetMaxBatchSize() {\r
138 \r
139                 appender.getMaxBatchSize();\r
140                 assertTrue(true);\r
141 \r
142         }\r
143 \r
144         @Test\r
145         public void testSetMaxBatchSize() {\r
146 \r
147                 appender.setMaxBatchSize(20);\r
148                 assertTrue(true);\r
149 \r
150         }\r
151 \r
152         @Test\r
153         public void testGetMaxAgeMs() {\r
154 \r
155                 appender.getMaxAgeMs();\r
156                 assertTrue(true);\r
157 \r
158         }\r
159 \r
160         @Test\r
161         public void testSetMaxAgeMs() {\r
162 \r
163                 appender.setMaxAgeMs(15);\r
164                 assertTrue(true);\r
165 \r
166         }\r
167 \r
168         @Test\r
169         public void testIsCompress() {\r
170 \r
171                 appender.isCompress();\r
172                 assertTrue(true);\r
173 \r
174         }\r
175 \r
176         @Test\r
177         public void testSetCompress() {\r
178 \r
179                 appender.setCompress(true);\r
180                 assertTrue(true);\r
181 \r
182         }\r
183 \r
184 }\r