2 * Copyright (c) 2015 NetIDE Consortium and others. All rights reserved.
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
8 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
10 import io.netty.buffer.ByteBuf;
11 import org.junit.Assert;
12 import org.junit.Before;
13 import org.junit.Test;
14 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
15 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
16 import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
17 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
18 import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
19 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput;
23 * @author giuseppex.petralia@intel.com
26 public class OF10SetConfigMessageFactoryTest {
27 private OFDeserializer<SetConfigInput> factory;
30 public void startUp() {
31 DeserializerRegistry desRegistry = new DeserializerRegistryImpl();
34 .getDeserializer(new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 9, SetConfigInput.class));
39 ByteBuf bb = BufferHelper.buildBuffer("00 01 00 03");
40 SetConfigInput deserializedMessage = BufferHelper.deserialize(factory, bb);
41 BufferHelper.checkHeaderV10(deserializedMessage);
42 Assert.assertEquals("Wrong switchConfigFlag", 0x01, deserializedMessage.getFlags().getIntValue());
43 Assert.assertEquals("Wrong missSendLen", 0x03, deserializedMessage.getMissSendLen().intValue());