update the package name
[dmaap/messagerouter/dmaapclient.git] / src / test / java / org / onap / dmaap / mr / test / support / MRBatchingPublisherMockTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP Policy Engine
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.dmaap.mr.test.support;
22
23 import static org.junit.Assert.assertTrue;
24
25 import java.lang.reflect.Constructor;
26 import java.lang.reflect.InvocationTargetException;
27 import java.lang.reflect.Method;
28 import java.util.ArrayList;
29 import java.util.concurrent.TimeUnit;
30
31 import org.junit.After;
32 import org.junit.Before;
33 import org.junit.Test;
34
35 import org.onap.dmaap.mr.client.HostSelector;
36 import org.onap.dmaap.mr.client.MRPublisher.message;
37 import org.onap.dmaap.mr.test.support.MRBatchingPublisherMock.Listener;
38
39 public class MRBatchingPublisherMockTest {
40         private MRBatchingPublisherMock pub = null;
41
42         private MRBatchingPublisherMock.Entry entry = null;
43
44         @Before
45         public void setUp() throws Exception {
46                 pub = new MRBatchingPublisherMock();
47                 entry = pub.new Entry("partition", "msg");
48
49         }
50
51         @After
52         public void tearDown() throws Exception {
53
54         }
55
56         @Test
57         public void testToString() {
58
59                 entry.toString();
60                 assertTrue(true);
61
62         }
63
64         @Test
65         public void testAddListener() {
66
67                 pub.addListener(null);
68                 assertTrue(true);
69
70         }
71
72         @Test
73         public void testGetCaptures() {
74
75                 pub.getCaptures();
76                 assertTrue(true);
77
78         }
79
80         @Test
81         public void testGetCaptures2() {
82
83                 pub.getCaptures(null);
84                 assertTrue(true);
85
86         }
87
88         @Test
89         public void testReceived() {
90
91                 pub.received();
92                 assertTrue(true);
93
94         }
95         
96         @Test
97         public void testResend() {
98
99                 pub.reset();
100                 assertTrue(true);
101
102         }
103         
104         @Test
105         public void testSend() {
106
107                 pub.send("partition", "msg");
108                 assertTrue(true);
109
110         }
111         
112         @Test
113         public void testSend2() {
114
115                 pub.send("msg");
116                 assertTrue(true);
117
118         }
119         
120         @Test
121         public void testSend3() {
122                 //sending message m obj
123                 pub.send(new ArrayList<message>());
124                 assertTrue(true);
125
126         }
127         
128         @Test
129         public void testSend4() {
130                 //sending collection of message m objects
131                 pub.send(new message("partition", "msg"));
132                 assertTrue(true);
133
134         }
135         
136         @Test
137         public void testSendBatchWithResponse() {
138
139                 pub.sendBatchWithResponse();
140                 assertTrue(true);
141
142         }
143         
144         @Test
145         public void testLogTo() {
146
147                 pub.logTo(null);
148                 assertTrue(true);
149
150         }
151         
152         @Test
153         public void testClearApiCredentials() {
154
155                 pub.clearApiCredentials();
156                 assertTrue(true);
157
158         }
159         
160         @Test
161         public void testSetApiCredentials() {
162
163                 pub.setApiCredentials("apikey", "apisecret");
164                 assertTrue(true);
165
166         }
167         
168         @Test
169         public void testClose() {
170
171                 pub.close();
172                 assertTrue(true);
173
174         }
175         
176         @Test
177         public void testClose2() {
178
179                 pub.close(100, null);
180                 assertTrue(true);
181
182         }
183         
184         @Test
185         public void testGetPendingMessageCount() {
186
187                 pub.getPendingMessageCount();
188                 assertTrue(true);
189
190         }
191 }