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.openflow.md.util;
10 import org.junit.Assert;
11 import org.junit.Test;
13 * test of {@link ActionUtil}
15 public class ActionUtilTest {
18 * Test method for {@link org.opendaylight.openflowplugin.openflow.md.util.ActionUtil#tosToDscp(short)}.
21 public void testTosToDscp() {
22 Assert.assertEquals(0, ActionUtil.tosToDscp((short) 1).intValue());
23 Assert.assertEquals(1, ActionUtil.tosToDscp((short) 4).intValue());
24 Assert.assertEquals(63, ActionUtil.tosToDscp((short) 252).intValue());
28 * Test method for {@link org.opendaylight.openflowplugin.openflow.md.util.ActionUtil#dscpToTos(short)}.
31 public void testDscpToTos() {
32 Assert.assertEquals(0, ActionUtil.dscpToTos((short) 0).intValue());
33 Assert.assertEquals(4, ActionUtil.dscpToTos((short) 1).intValue());
34 Assert.assertEquals(16, ActionUtil.dscpToTos((short) 4).intValue());
35 Assert.assertEquals(252, ActionUtil.dscpToTos((short) 63).intValue());