BUG-608 : added prefix-sid tlv
[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 java.util.HashMap;
14 import java.util.Map;
15 import org.junit.Test;
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.rev150210.LinkstateAddressFamily;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.LinkstateSubsequentAddressFamily;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.SubsequentAddressFamily;
22
23 public class ApiTest {
24
25     @Test
26     public void testBGPSessionProposalImpl() {
27         final Map<Class<? extends AddressFamily>, Class<? extends SubsequentAddressFamily>> map = new HashMap<>();
28         map.put(LinkstateAddressFamily.class, LinkstateSubsequentAddressFamily.class);
29
30         final BGPSessionProposalImpl proposal = new BGPSessionProposalImpl((short) 5, new AsNumber(58L), null, map);
31         final BGPSessionPreferences sp = proposal.getProposal();
32         assertNull(sp.getBgpId());
33         assertEquals(proposal.getHoldTimer(), sp.getHoldTime());
34         assertEquals(proposal.getAs(), sp.getMyAs());
35         assertNull(proposal.getBgpId());
36
37     }
38 }