1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
\r
2 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
\r
4 import io.netty.buffer.ByteBuf;
\r
6 import org.junit.Assert;
\r
7 import org.junit.Test;
\r
8 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
\r
9 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutput;
\r
12 * @author timotej.kubas
\r
13 * @author michal.polkorab
\r
15 public class RoleReplyMessageFactoryTest {
\r
18 * Testing of {@link RoleReplyMessageFactory} for correct translation into POJO
\r
22 ByteBuf bb = BufferHelper.buildBuffer("00 00 00 02 00 00 00 00 00 01 02 03 04 05 06 07");
\r
23 RoleRequestOutput builtByFactory = BufferHelper.decodeV13(RoleReplyMessageFactory.getInstance(), bb);
\r
25 BufferHelper.checkHeaderV13(builtByFactory);
\r
27 Assert.assertEquals("Wrong role", 0x02, builtByFactory.getRole().getIntValue());
\r
28 Assert.assertEquals("Wrong generationId", 0x01020304050607L, builtByFactory.getGenerationId().longValue());
\r