2 * Copyright (c) 2013 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.protocol.bgp.rib.impl;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNull;
13 import org.junit.Test;
14 import org.opendaylight.protocol.bgp.concepts.BGPAddressFamily;
15 import org.opendaylight.protocol.bgp.concepts.BGPSubsequentAddressFamily;
16 import org.opendaylight.protocol.bgp.concepts.BGPTableType;
17 import org.opendaylight.protocol.bgp.parser.BGPUpdateSynchronized;
18 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionPreferences;
19 import org.opendaylight.protocol.concepts.ASNumber;
20 import org.opendaylight.protocol.framework.SessionPreferences;
22 public class ApiTest {
25 public void testBGPSessionPreferences() {
26 final SessionPreferences sp = new BGPSessionPreferences(new ASNumber(58), (short) 5, null, null);
27 assertNull(((BGPSessionPreferences) sp).getBgpId());
28 assertEquals((short) 5, ((BGPSessionPreferences) sp).getHoldTime());
29 assertEquals(58, ((BGPSessionPreferences) sp).getMyAs().getAsn());
33 public void testBGPUpdateSynchronized() {
34 final BGPTableType tt = new BGPTableType(BGPAddressFamily.IPv4, BGPSubsequentAddressFamily.Linkstate);
35 final BGPUpdateSynchronized update = new BGPUpdateSynchronizedImpl(tt);
36 assertEquals(tt, update.getTableType());