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.ExperimenterMessage;
\r
12 * @author michal.polkorab
\r
15 public class ExperimenterMessageFactoryTest {
\r
18 * Testing {@link ExperimenterMessageFactory} for correct translation into POJO
\r
21 public void test() {
\r
22 ByteBuf bb = BufferHelper.buildBuffer("01 02 03 04 01 02 03 04");
\r
23 ExperimenterMessage builtByFactory = BufferHelper.decodeV13(
\r
24 ExperimenterMessageFactory.getInstance(), bb);
\r
26 BufferHelper.checkHeaderV13(builtByFactory);
\r
27 Assert.assertEquals("Wrong experimenter", 0x01020304L, builtByFactory.getExperimenter().longValue());
\r
28 Assert.assertEquals("Wrong expType", 0x01020304L, builtByFactory.getExpType().longValue());
\r