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