Instructions fix - Write/Apply actions instructions now support sending drop action
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / serialization / factories / OF10HelloInputMessageFactoryTest.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.serialization.factories;
10
11 import io.netty.buffer.ByteBuf;
12 import io.netty.buffer.UnpooledByteBufAllocator;
13
14 import org.junit.Test;
15 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
16 import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInputBuilder;
19
20 /**
21  * @author michal.polkorab
22  *
23  */
24 public class OF10HelloInputMessageFactoryTest {
25
26     /**
27      * Testing of {@link OF10HelloInputMessageFactory} for correct translation from POJO
28      * @throws Exception 
29      */
30     @Test
31     public void testWithoutElementsSet() throws Exception {
32         HelloInputBuilder hib = new HelloInputBuilder();
33         BufferHelper.setupHeader(hib, EncodeConstants.OF10_VERSION_ID);
34         HelloInput hi = hib.build();
35         
36         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
37         OF10HelloInputMessageFactory himf = OF10HelloInputMessageFactory.getInstance();
38         himf.messageToBuffer(EncodeConstants.OF10_VERSION_ID, out, hi);
39         
40         BufferHelper.checkHeaderV10(out, (byte) 0, 8);
41     }
42
43 }