e26ceb05e82fd4ee01bcf521b477d77aeb47cc44
[bgpcep.git] / bgp / rib-impl / src / test / java / org / opendaylight / protocol / bgp / rib / impl / ApiTest.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.protocol.bgp.rib.impl;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNull;
12
13 import org.junit.Test;
14 import org.opendaylight.protocol.bgp.concepts.BGPTableType;
15 import org.opendaylight.protocol.bgp.parser.BGPUpdateSynchronized;
16 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionPreferences;
17 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev130918.LinkstateAddressFamily;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev130918.LinkstateSubsequentAddressFamily;
20
21 public class ApiTest {
22
23         @Test
24         public void testBGPSessionPreferences() {
25                 final BGPSessionPreferences sp = new BGPSessionPreferences(new AsNumber((long) 58), (short) 5, null, null);
26                 assertNull(sp.getBgpId());
27                 assertEquals((short) 5, sp.getHoldTime());
28                 assertEquals(58, sp.getMyAs().getValue().longValue());
29         }
30
31         @Test
32         public void testBGPUpdateSynchronized() {
33                 final BGPTableType tt = new BGPTableType(LinkstateAddressFamily.class, LinkstateSubsequentAddressFamily.class);
34                 final BGPUpdateSynchronized update = new BGPUpdateSynchronizedImpl(tt);
35                 assertEquals(tt, update.getTableType());
36         }
37 }