Merge remote-tracking branch 'liblldp/master'
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / util / PacketInUtilTest.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.openflowplugin.impl.util;
10
11 import static org.junit.Assert.assertTrue;
12
13 import org.junit.Test;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.InvalidTtl;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.NoMatch;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.SendToController;
18
19 /**
20  * Created by Martin Bobak mbobak@cisco.com on 7/2/14.
21  */
22 public class PacketInUtilTest {
23
24     /**
25      * Test method for PacketInUtil#getMdSalPacketInReason(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow
26      * .common.types.rev130731.PacketInReason).
27      */
28     @Test
29     public void testGetMdSalPacketInReason() {
30         Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketInReason>
31                 resultReason;
32
33         resultReason = PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRACTION);
34         assertTrue(resultReason.getName().equals(SendToController.class.getName()));
35
36         resultReason = PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRINVALIDTTL);
37         assertTrue(resultReason.getName().equals(InvalidTtl.class.getName()));
38
39         resultReason = PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRNOMATCH);
40         assertTrue(resultReason.getName().equals(NoMatch.class.getName()));
41
42     }
43 }