2 * Copyright (c) 2014 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.match;
11 import io.netty.buffer.ByteBuf;
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.augments.rev131002.BosMatchEntry;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsBos;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
22 * @author michal.polkorab
25 public class OxmMplsBosDeserializerTest {
28 * Tests {@link OxmMplsBosDeserializer#deserialize(ByteBuf)}
32 ByteBuf buffer = BufferHelper.buildBuffer("80 00 48 01 00");
34 buffer.skipBytes(4); // skip XID
35 OxmMplsBosDeserializer deserializer = new OxmMplsBosDeserializer();
36 MatchEntries entry = deserializer.deserialize(buffer);
38 Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass());
39 Assert.assertEquals("Wrong entry field", MplsBos.class, entry.getOxmMatchField());
40 Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask());
41 Assert.assertEquals("Wrong entry value", false, entry.getAugmentation(BosMatchEntry.class).isBos());