blob: 47ef5b3bd28b67d30970bc7e1bf8d30a1fbbb7ab [file] [log] [blame]
Sean Condon0e89bda2017-03-21 14:23:19 +00001/*
2 * Copyright 2017-present Open Networking Foundation
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 */
16package org.onosproject.incubator.net.l2monitoring.cfm;
17
18import static org.junit.Assert.assertEquals;
19
20import org.junit.Before;
21import org.junit.Test;
22
23public class MepLbEntryTest {
24
25 MepLbEntry lbResult;
26
27 @Before
28 public void setUp() throws Exception {
29 lbResult = DefaultMepLbEntry.builder()
30 .countLbrMacMisMatch(987654321L)
31 .countLbrReceived(987654322L)
32 .countLbrTransmitted(987654323L)
33 .countLbrValidInOrder(987654324L)
34 .countLbrValidOutOfOrder(987654325L)
35 .nextLbmIdentifier(987654326L)
36 .build();
37 }
38
39 @Test
40 public void testNextLbmIdentifier() {
41 assertEquals(987654326L, lbResult.nextLbmIdentifier());
42 }
43
44 @Test
45 public void testCountLbrTransmitted() {
46 assertEquals(987654323L, lbResult.countLbrTransmitted());
47 }
48
49 @Test
50 public void testCountLbrReceived() {
51 assertEquals(987654322L, lbResult.countLbrReceived());
52 }
53
54 @Test
55 public void testCountLbrValidInOrder() {
56 assertEquals(987654324L, lbResult.countLbrValidInOrder());
57 }
58
59 @Test
60 public void testCountLbrValidOutOfOrder() {
61 assertEquals(987654325L, lbResult.countLbrValidOutOfOrder());
62 }
63
64 @Test
65 public void testCountLbrMacMisMatch() {
66 assertEquals(987654321L, lbResult.countLbrMacMisMatch());
67 }
68
69}