Added unit tests
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / connection / MessageListenerWrapperTest.java
1 /*\r
2  * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 \r
9 package org.opendaylight.openflowjava.protocol.impl.connection;\r
10 \r
11 import org.junit.Assert;\r
12 import org.junit.Test;\r
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;\r
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInputBuilder;\r
15 \r
16 /**\r
17  * @author michal.polkorab\r
18  *\r
19  */\r
20 public class MessageListenerWrapperTest {\r
21 \r
22     /**\r
23      * Test MessageListenerWrapper creation\r
24      */\r
25     @Test\r
26     public void test() {\r
27         HelloInputBuilder builder = new HelloInputBuilder();\r
28         HelloInput hello = builder.build();\r
29         SimpleRpcListener listener = new SimpleRpcListener(hello, "Error");\r
30         MessageListenerWrapper wrapper = new MessageListenerWrapper(hello, listener);\r
31         Assert.assertEquals("Wrong message", hello, wrapper.getMsg());\r
32         Assert.assertEquals("Wrong listener", listener, wrapper.getListener());\r
33     }\r
34 }