Do not use RibSupportUtils in SynchronizationAndExceptionTest
[bgpcep.git] / bgp / rib-impl / src / test / java / org / opendaylight / protocol / bgp / rib / impl / RibSupportUtilsTest.java
1 /*
2  * Copyright (c) 2015 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.assertFalse;
12 import static org.junit.Assert.assertTrue;
13
14 import java.util.Map;
15 import org.junit.Test;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.Tables;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.UnicastSubsequentAddressFamily;
20 import org.opendaylight.yangtools.yang.common.QName;
21 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
22
23 public class RibSupportUtilsTest {
24     @Test
25     public void testYangTablesKey() {
26         final NodeIdentifierWithPredicates p = RibSupportUtils.toYangTablesKey(new TablesKey(Ipv4AddressFamily.VALUE,
27             UnicastSubsequentAddressFamily.VALUE));
28         final Map<QName, Object> m = p.asMap();
29         assertFalse(m.isEmpty());
30         assertEquals(Tables.QNAME, p.getNodeType());
31         assertTrue(m.containsValue(Ipv4AddressFamily.QNAME));
32         assertTrue(m.containsValue(UnicastSubsequentAddressFamily.QNAME));
33     }
34 }