b0e7dd6584fd817b2ed7b789e46ca83741c6e7be
[hc2vpp.git] /
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package io.fd.hc2vpp.common.translate.util;
18
19 import static org.junit.Assert.assertEquals;
20
21 import io.fd.vpp.jvpp.core.types.FibMplsLabel;
22 import org.junit.Test;
23
24 public class MplsLabelTranslatorTest implements MplsLabelTranslator {
25     @Test
26     public void testTranslateLong() {
27         final int expectedLabel = 1048575;
28         final FibMplsLabel expected  = new FibMplsLabel();
29         expected.label = expectedLabel;
30         assertEquals(expected, translate(Long.valueOf(1048575)));
31     }
32     @Test
33     public void testTranslateInt() {
34         final int expectedLabel = 11;
35         final FibMplsLabel expected  = new FibMplsLabel();
36         expected.label = expectedLabel;
37         assertEquals(expected, translate(expectedLabel));
38     }
39
40 }