1 package org.opendaylight.controller.sal.connector.remoterpc;
3 import junit.framework.Assert;
4 import org.junit.Before;
6 import org.opendaylight.controller.sal.connector.remoterpc.dto.MessageWrapper;
7 import org.opendaylight.controller.sal.connector.remoterpc.dto.Message;
9 import java.util.concurrent.TimeoutException;
11 public class ClientTest {
17 client = new Client();
18 client.getRequestQueue().clear();
22 public void testStop() throws Exception {
27 public void testPool() throws Exception {
32 public void process_AddAMessage_ShouldAddToQueue() throws Exception {
33 client.process(getEmptyMessageWrapper());
34 Assert.assertEquals(1, client.getRequestQueue().size());
38 * Queue size is 100. Adding 101 message should time out in 2 sec
39 * if server does not process it
42 @Test(expected = TimeoutException.class)
43 public void process_Add101Message_ShouldThrow() throws Exception {
44 for (int i=0;i<101;i++){
45 client.process(getEmptyMessageWrapper());
50 public void testStart() throws Exception {
53 private MessageWrapper getEmptyMessageWrapper(){
54 return new MessageWrapper(new Message(), null);