Change EchoReq/Res factories to version assignable
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / OF10GetConfigInputMessageFactoryTest.java
1 /*
2  * Copyright (c) 2015 NetIDE Consortium 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 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
9
10 import io.netty.buffer.ByteBuf;
11 import org.junit.Before;
12 import org.junit.Test;
13 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
14 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
15 import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
16 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
17 import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
18 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigInput;
20
21 /**
22  * @author giuseppex.petralia@intel.com
23  *
24  */
25 public class OF10GetConfigInputMessageFactoryTest {
26     private OFDeserializer<GetConfigInput> factory;
27
28     @Before
29     public void startUp() {
30         DeserializerRegistry desRegistry = new DeserializerRegistryImpl();
31         desRegistry.init();
32         factory = desRegistry
33                 .getDeserializer(new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 7, GetConfigInput.class));
34     }
35
36     @Test
37     public void test() {
38         ByteBuf bb = BufferHelper.buildBuffer();
39         GetConfigInput deserializedMessage = BufferHelper.deserialize(factory, bb);
40         BufferHelper.checkHeaderV10(deserializedMessage);
41     }
42 }