51c700e74a612f18f5bd9a847c8ad006f8815e8c
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / BarrierReplyMessageFactoryTest.java
1 /*
2  * Copyright (c) 2013 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
9 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
10
11 import io.netty.buffer.ByteBuf;
12
13 import org.junit.Test;
14 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
16
17 /**
18  * @author michal.polkorab
19  * @author timotej.kubas
20  */
21 public class BarrierReplyMessageFactoryTest {
22
23     /**
24      * Testing of {@link BarrierReplyMessageFactory} for correct translation into POJO
25      */
26     @Test
27     public void test() {
28         ByteBuf bb = BufferHelper.buildBuffer();
29         BarrierOutput builtByFactory = BufferHelper.decodeV13(
30                 BarrierReplyMessageFactory.getInstance(), bb);
31
32         BufferHelper.checkHeaderV13(builtByFactory);
33     }
34     
35     /**
36      * Testing of {@link BarrierReplyMessageFactory} for correct translation into POJO
37      */
38     @Test
39     public void testV10() {
40         ByteBuf bb = BufferHelper.buildBuffer();
41         BarrierOutput builtByFactory = BufferHelper.decodeV10(
42                 BarrierReplyMessageFactory.getInstance(), bb);
43
44         BufferHelper.checkHeaderV10(builtByFactory);
45     }
46 }