YANG revision dates mass-update
[bgpcep.git] / bgp / extensions / evpn / src / test / java / org / opendaylight / protocol / bgp / evpn / impl / BGPActivatorTest.java
1 /*
2  * Copyright (c) 2016 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.evpn.impl;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNull;
12 import static org.opendaylight.protocol.bgp.evpn.impl.BGPActivator.EVPN_SAFI;
13 import static org.opendaylight.protocol.bgp.evpn.impl.BGPActivator.L2VPN_AFI;
14
15 import org.junit.Test;
16 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
17 import org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.EvpnSubsequentAddressFamily;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.L2vpnAddressFamily;
20
21 public class BGPActivatorTest {
22     @Test
23     public void testActivator() throws Exception {
24         final BGPActivator act = new BGPActivator();
25         final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
26         assertNull(context.getAddressFamilyRegistry().classForFamily(L2VPN_AFI));
27         assertNull(context.getSubsequentAddressFamilyRegistry().classForFamily(EVPN_SAFI));
28         act.start(context);
29         assertEquals(L2vpnAddressFamily.class, context.getAddressFamilyRegistry().classForFamily(L2VPN_AFI));
30         assertEquals(EvpnSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry()
31                 .classForFamily(EVPN_SAFI));
32         act.close();
33     }
34 }