Extensibility support (serialization part)
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / OF10VendorMessageFactoryTest.java
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
10
11 import io.netty.buffer.ByteBuf;
12
13 import org.junit.Assert;
14 import org.junit.Test;
15 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
17
18 /**
19  * @author michal.polkorab
20  */
21 public class OF10VendorMessageFactoryTest {
22
23         /**
24      * Testing {@link OF10VendorMessageFactory} for correct translation into POJO
25      */
26     @Test
27     public void test() {
28         ByteBuf bb = BufferHelper.buildBuffer("01 02 03 04");
29         ExperimenterMessage builtByFactory = BufferHelper.decodeV10(
30                 OF10VendorMessageFactory.getInstance(), bb);
31
32         BufferHelper.checkHeaderV10(builtByFactory);
33         Assert.assertEquals("Wrong experimenter", 0x01020304L, builtByFactory.getExperimenter().longValue());
34     }
35 }