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
9 package org.opendaylight.openflowplugin.openflow.md.util;
11 import org.junit.Test;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.InvalidTtl;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.NoMatch;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.SendToController;
17 import static org.junit.Assert.assertTrue;
20 * Created by Martin Bobak mbobak@cisco.com on 7/2/14.
22 public class PacketInUtilTest {
26 * Test method for PacketInUtil#getMdSalPacketInReason(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason);
29 public void testGetMdSalPacketInReason() {
30 Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketInReason> resultReason;
32 resultReason = PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRACTION);
33 assertTrue(resultReason.getName().equals(SendToController.class.getName()));
35 resultReason = PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRINVALIDTTL);
36 assertTrue(resultReason.getName().equals(InvalidTtl.class.getName()));
38 resultReason = PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRNOMATCH);
39 assertTrue(resultReason.getName().equals(NoMatch.class.getName()));