18992b6263f3ccfed7c971c67363c9e15a594059
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / core / 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.core.connection;\r
10 \r
11 import org.junit.Assert;\r
12 import org.junit.Test;\r
13 import org.opendaylight.openflowjava.protocol.impl.core.connection.MessageListenerWrapper;\r
14 import org.opendaylight.openflowjava.protocol.impl.core.connection.SimpleRpcListener;\r
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;\r
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInputBuilder;\r
17 \r
18 /**\r
19  * @author michal.polkorab\r
20  *\r
21  */\r
22 public class MessageListenerWrapperTest {\r
23 \r
24     /**\r
25      * Test MessageListenerWrapper creation\r
26      */\r
27     @Test\r
28     public void test() {\r
29         HelloInputBuilder builder = new HelloInputBuilder();\r
30         HelloInput hello = builder.build();\r
31         SimpleRpcListener listener = new SimpleRpcListener(hello, "Error");\r
32         MessageListenerWrapper wrapper = new MessageListenerWrapper(hello, listener);\r
33         Assert.assertEquals("Wrong message", hello, wrapper.getMsg());\r
34         Assert.assertEquals("Wrong listener", listener, wrapper.getListener());\r
35     }\r
36 }