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.deserialization.factories.HelloMessageFactoryTest;
\r
9 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
\r
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigInput;
\r
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigInputBuilder;
\r
14 * @author michal.polkorab
\r
17 public class GetConfigInputMessageFactoryTest {
\r
19 private static final byte GET_CONFIG_REQUEST_MESSAGE_CODE_TYPE = GetConfigInputMessageFactory.MESSAGE_TYPE;
\r
22 * Testing of {@link GetConfigInputMessageFactory} for correct translation from POJO
\r
23 * @throws Exception
\r
26 public void test() throws Exception {
\r
27 GetConfigInputBuilder gcib = new GetConfigInputBuilder();
\r
28 BufferHelper.setupHeader(gcib);
\r
29 GetConfigInput gci = gcib.build();
\r
31 ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
\r
32 GetConfigInputMessageFactory gcimf = GetConfigInputMessageFactory.getInstance();
\r
33 gcimf.messageToBuffer(HelloMessageFactoryTest.VERSION_YET_SUPPORTED, out, gci);
\r
35 BufferHelper.checkHeaderV13(out, GET_CONFIG_REQUEST_MESSAGE_CODE_TYPE, 8);
\r