Extend openflow-protocol-impl serialization
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / GetAsyncRequestMessageFactoryTest.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.GetAsyncInput;
20
21 /**
22  * @author giuseppex.petralia@intel.com
23  *
24  */
25 public class GetAsyncRequestMessageFactoryTest {
26     private OFDeserializer<GetAsyncInput> factory;
27
28     @Before
29     public void startUp() {
30         DeserializerRegistry desRegistry = new DeserializerRegistryImpl();
31         desRegistry.init();
32         factory = desRegistry
33                 .getDeserializer(new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 26, GetAsyncInput.class));
34
35     }
36
37     @Test
38     public void test() {
39         ByteBuf bb = BufferHelper.buildBuffer();
40         GetAsyncInput deserializedMessage = BufferHelper.deserialize(factory, bb);
41         BufferHelper.checkHeaderV13(deserializedMessage);
42     }
43 }