2 * Copyright (c) 2014 Cisco Systems, Inc. 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.openflowplugin.impl.util;
10 import static org.junit.Assert.assertEquals;
12 import org.junit.Test;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.InvalidTtl;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.NoMatch;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.SendToController;
19 * Created by Martin Bobak mbobak@cisco.com on 7/2/14.
21 public class PacketInUtilTest {
23 * Test method for PacketInUtil#getMdSalPacketInReason(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow
24 * .common.types.rev130731.PacketInReason).
27 public void testGetMdSalPacketInReason() {
28 assertEquals(SendToController.VALUE, PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRACTION));
29 assertEquals(InvalidTtl.VALUE, PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRINVALIDTTL));
30 assertEquals(NoMatch.VALUE, PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRNOMATCH));