2 * Copyright (c) 2019 Pantheon Technologies, s.r.o. 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.protocol.bgp.rib.impl;
10 import static org.junit.Assert.assertEquals;
11 import static org.opendaylight.protocol.bgp.rib.impl.AbstractBGPSessionNegotiator.AS_TRANS;
12 import static org.opendaylight.protocol.bgp.rib.impl.AbstractBGPSessionNegotiator.openASNumber;
14 import org.junit.Test;
16 public class AbstractBGPSessionNegotiatorTest {
18 public void testOpenASNumber() {
19 assertEquals(0, openASNumber(0));
20 assertEquals(65535, openASNumber(65535));
21 assertEquals(AS_TRANS, openASNumber(65536));
22 assertEquals(AS_TRANS, openASNumber(Integer.MAX_VALUE));
23 assertEquals(AS_TRANS, openASNumber(2147483648L));
24 assertEquals(AS_TRANS, openASNumber(4294967295L));