2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.protocol.bgp.evpn.impl;
10 import org.opendaylight.bgp.concepts.RouteDistinguisherUtil;
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
14 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.RouteDistinguisher;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
18 import org.opendaylight.yangtools.yang.common.Uint16;
19 import org.opendaylight.yangtools.yang.common.Uint32;
20 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
21 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
22 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
23 import org.opendaylight.yangtools.yang.data.api.schema.builder.DataContainerNodeBuilder;
24 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
25 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
27 public final class EvpnTestUtil {
28 public static final int VALUE_SIZE = 9;
29 public static final Uint32 LD = Uint32.valueOf(33686018);
30 public static final String MAC_MODEL = "f2:0c:dd:80:9f:f7";
31 public static final MacAddress MAC = new MacAddress(MAC_MODEL);
32 public static final Uint32 AS_MODEL = Uint32.valueOf(16843009);
33 public static final AsNumber AS_NUMBER = new AsNumber(AS_MODEL);
34 public static final Uint16 PORT = Uint16.valueOf(514);
35 public static final Uint32 MPLS_LABEL_MODEL = Uint32.valueOf(24001L);
36 public static final MplsLabel MPLS_LABEL = new MplsLabel(MPLS_LABEL_MODEL);
37 public static final int COMMUNITY_VALUE_SIZE = 6;
38 public static final Uint32 VLAN = Uint32.TEN;
39 public static final String IP_MODEL = "127.0.0.1";
40 public static final IpAddressNoZone IP = new IpAddressNoZone(new Ipv4AddressNoZone(IP_MODEL));
41 public static final String IPV6_MODEL = "2001::1";
42 public static final IpAddressNoZone IPV6 = new IpAddressNoZone(new Ipv6AddressNoZone(IPV6_MODEL));
43 public static final Uint32 MPLS_LABEL2_MODEL = Uint32.valueOf(24002L);
44 public static final MplsLabel MPLS_LABEL2 = new MplsLabel(MPLS_LABEL2_MODEL);
45 public static final String RD_MODEL = "1.2.3.4:258";
46 public static final RouteDistinguisher RD = RouteDistinguisherUtil.parseRouteDistinguisher(RD_MODEL);
48 private EvpnTestUtil() {
52 public static DataContainerNodeBuilder<NodeIdentifier, ContainerNode> createContBuilder(final NodeIdentifier nid) {
53 return Builders.containerBuilder().withNodeIdentifier(nid);
56 public static <T> LeafNode<T> createValue(final T value, final NodeIdentifier nid) {
57 return ImmutableNodes.leafNode(nid, value);