Copyright update
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / GetConfigReplyMessageFactoryTest.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.GetConfigOutput;
17
18 /**
19  * @author michal.polkorab
20  * @author timotej.kubas
21  */
22 public class GetConfigReplyMessageFactoryTest {
23
24     /**
25      * Testing {@link GetConfigReplyMessageFactory} for correct translation into POJO
26      */
27     @Test
28     public void test() {
29         ByteBuf bb = BufferHelper.buildBuffer("00 01 00 03");
30         GetConfigOutput builtByFactory = BufferHelper.decodeV13(
31                 GetConfigReplyMessageFactory.getInstance(), bb);
32
33         BufferHelper.checkHeaderV13(builtByFactory);
34         Assert.assertEquals("Wrong switchConfigFlag", 0x01, builtByFactory.getFlags().getIntValue()); 
35         Assert.assertEquals("Wrong missSendLen", 0x03, builtByFactory.getMissSendLen().intValue());
36     }
37     
38 }