145b49b71e6a37a5d26c45965805e9d581482aa1
[bgpcep.git] / bgp / 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
13 import org.junit.Test;
14 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
15 import org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.EvpnSubsequentAddressFamily;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.L2vpnAddressFamily;
18
19 public class BGPActivatorTest {
20     @Test
21     public void testActivator() throws Exception {
22         final BGPActivator act = new BGPActivator();
23         final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
24         assertNull(context.getAddressFamilyRegistry().classForFamily(25));
25         assertNull(context.getSubsequentAddressFamilyRegistry().classForFamily(70));
26         act.start(context);
27         assertEquals(L2vpnAddressFamily.class, context.getAddressFamilyRegistry().classForFamily(25));
28         assertEquals(EvpnSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry().classForFamily(70));
29         act.close();
30     }
31 }