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.GetAsyncInput;
\r
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInputBuilder;
\r
14 * @author timotej.kubas
\r
15 * @author michal.polkorab
\r
17 public class GetaAsyncRequestMessageFactoryTest {
\r
18 private static final byte MESSAGE_TYPE = 26;
\r
19 private static final int MESSAGE_LENGTH = 8;
\r
22 * Testing of {@link GetaAsyncRequestMessageFactory} for correct translation from POJO
\r
23 * @throws Exception
\r
26 public void testGetaAsyncReques() throws Exception {
\r
27 GetAsyncInputBuilder builder = new GetAsyncInputBuilder();
\r
28 BufferHelper.setupHeader(builder);
\r
29 GetAsyncInput message = builder.build();
\r
31 ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
\r
32 GetAsyncRequestMessageFactory factory = GetAsyncRequestMessageFactory.getInstance();
\r
33 factory.messageToBuffer(HelloMessageFactoryTest.VERSION_YET_SUPPORTED, out, message);
\r
35 BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, MESSAGE_LENGTH);
\r