2 * Copyright (c) 2013 Pantheon Technologies s.r.o. 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
9 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
11 import io.netty.buffer.ByteBuf;
13 import org.junit.Before;
14 import org.junit.Test;
15 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
16 import org.opendaylight.openflowjava.protocol.api.extensibility.MessageCodeKey;
17 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
18 import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
19 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
20 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
24 * @author michal.polkorab
25 * @author timotej.kubas
27 public class BarrierReplyMessageFactoryTest {
29 private OFDeserializer<BarrierOutput> barrierFactory;
32 * Initializes deserializer registry and lookups correct deserializer
35 public void startUp() {
36 DeserializerRegistry registry = new DeserializerRegistryImpl();
38 barrierFactory = registry.getDeserializer(
39 new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 21, BarrierOutput.class));
43 * Testing of {@link BarrierReplyMessageFactory} for correct translation into POJO
47 ByteBuf bb = BufferHelper.buildBuffer();
48 BarrierOutput builtByFactory = BufferHelper.deserialize(
51 BufferHelper.checkHeaderV13(builtByFactory);