1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
\r
2 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
\r
4 import io.netty.buffer.ByteBuf;
\r
5 import io.netty.buffer.UnpooledByteBufAllocator;
\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
14 * @author michal.polkorab
\r
17 public class OF10HelloInputMessageFactoryTest {
\r
20 * Testing of {@link OF10HelloInputMessageFactory} for correct translation from POJO
\r
21 * @throws Exception
\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
29 ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
\r
30 OF10HelloInputMessageFactory himf = OF10HelloInputMessageFactory.getInstance();
\r
31 himf.messageToBuffer(EncodeConstants.OF10_VERSION_ID, out, hi);
\r
33 BufferHelper.checkHeaderV10(out, (byte) 0, 8);
\r