Add missing license headers
[openflowplugin.git] / openflowplugin / src / test / java / org / opendaylight / openflowplugin / openflow / md / 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.openflow.md.util;
10
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;
16
17 import static org.junit.Assert.assertTrue;
18
19 /**
20  * Created by Martin Bobak mbobak@cisco.com on 7/2/14.
21  */
22 public class PacketInUtilTest {
23
24
25     /**
26      * Test method for PacketInUtil#getMdSalPacketInReason(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.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> resultReason;
31
32         resultReason = PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRACTION);
33         assertTrue(resultReason.getName().equals(SendToController.class.getName()));
34
35         resultReason = PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRINVALIDTTL);
36         assertTrue(resultReason.getName().equals(InvalidTtl.class.getName()));
37
38         resultReason = PacketInUtil.getMdSalPacketInReason(PacketInReason.OFPRNOMATCH);
39         assertTrue(resultReason.getName().equals(NoMatch.class.getName()));
40
41     }
42 }