Merge "Quickfix - Vlan-vid match entry"
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / serialization / factories / OF10HelloInputMessageFactoryTest.java
1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
2 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;\r
3 \r
4 import io.netty.buffer.ByteBuf;\r
5 import io.netty.buffer.UnpooledByteBufAllocator;\r
6 \r
7 import org.junit.Test;\r
8 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;\r
9 import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;\r
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;\r
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInputBuilder;\r
12 \r
13 /**\r
14  * @author michal.polkorab\r
15  *\r
16  */\r
17 public class OF10HelloInputMessageFactoryTest {\r
18 \r
19     /**\r
20      * Testing of {@link OF10HelloInputMessageFactory} for correct translation from POJO\r
21      * @throws Exception \r
22      */\r
23     @Test\r
24     public void testWithoutElementsSet() throws Exception {\r
25         HelloInputBuilder hib = new HelloInputBuilder();\r
26         BufferHelper.setupHeader(hib, EncodeConstants.OF10_VERSION_ID);\r
27         HelloInput hi = hib.build();\r
28         \r
29         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();\r
30         OF10HelloInputMessageFactory himf = OF10HelloInputMessageFactory.getInstance();\r
31         himf.messageToBuffer(EncodeConstants.OF10_VERSION_ID, out, hi);\r
32         \r
33         BufferHelper.checkHeaderV10(out, (byte) 0, 8);\r
34     }\r
35 \r
36 }\r