2 * Copyright (c) 2016, 2017 Red Hat, 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.netvirt.elanmanager.tests;
10 import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
11 import org.opendaylight.genius.interfacemanager.globals.InterfaceInfo;
12 import org.opendaylight.genius.testutils.interfacemanager.TunnelInterfaceDetails;
13 import org.opendaylight.mdsal.binding.testutils.AssertDataObjects;
14 import org.opendaylight.mdsal.binding.testutils.XtendBuilderExtensions;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
16 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
17 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceBuilder;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlan;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlanBuilder;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefs;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefsBuilder;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
26 * Definitions of complex objects expected in tests.
28 * These were originally generated {@link AssertDataObjects#assertEqualBeans}.
30 @SuppressWarnings("all")
31 public class ExpectedObjects {
32 public static String ELAN1 = "34701c04-1118-4c65-9425-78a80d49a211";
34 public static Long ELAN1_SEGMENT_ID = Long.valueOf(100L);
36 public static Interface newInterfaceConfig(final String interfaceName, final String parentName) {
37 InterfaceBuilder _interfaceBuilder = new InterfaceBuilder();
38 final Procedure1<InterfaceBuilder> _function = (InterfaceBuilder it) -> {
39 it.setDescription(interfaceName);
40 it.setName(interfaceName);
41 it.setType(L2vlan.class);
42 ParentRefsBuilder _parentRefsBuilder = new ParentRefsBuilder();
43 final Procedure1<ParentRefsBuilder> _function_1 = (ParentRefsBuilder it_1) -> {
44 it_1.setParentInterface(parentName);
46 ParentRefs _doubleGreaterThan = XtendBuilderExtensions.<ParentRefs, ParentRefsBuilder>operator_doubleGreaterThan(_parentRefsBuilder, _function_1);
47 it.addAugmentation(ParentRefs.class, _doubleGreaterThan);
48 IfL2vlanBuilder _ifL2vlanBuilder = new IfL2vlanBuilder();
49 final Procedure1<IfL2vlanBuilder> _function_2 = (IfL2vlanBuilder it_1) -> {
50 it_1.setL2vlanMode(IfL2vlan.L2vlanMode.Trunk);
51 VlanId _vlanId = new VlanId(Integer.valueOf(0));
52 it_1.setVlanId(_vlanId);
54 IfL2vlan _doubleGreaterThan_1 = XtendBuilderExtensions.<IfL2vlan, IfL2vlanBuilder>operator_doubleGreaterThan(_ifL2vlanBuilder, _function_2);
55 it.addAugmentation(IfL2vlan.class, _doubleGreaterThan_1);
57 return XtendBuilderExtensions.<Interface, InterfaceBuilder>operator_doubleGreaterThan(_interfaceBuilder, _function);
60 public static Object createElanInstance() {
61 throw new Error("Unresolved compilation problems:"
62 + "\nElanInstancesBuilder cannot be resolved."
63 + "\nThe method elanInstance(List<Object>) is undefined"
64 + "\nElanInstanceBuilder cannot be resolved."
65 + "\nThe method description(String) is undefined"
66 + "\nThe method elanInstanceName(String) is undefined"
67 + "\nThe method elanTag(long) is undefined"
68 + "\nThe method macTimeout(long) is undefined"
69 + "\n>> cannot be resolved"
70 + "\n>> cannot be resolved");
73 public static Object createElanInstance(final String elan, final Long segmentId) {
74 throw new Error("Unresolved compilation problems:"
75 + "\nElanInstanceBuilder cannot be resolved."
76 + "\nThe method elanInstanceName(String) is undefined"
77 + "\nThe method description(String) is undefined"
78 + "\nThe method segmentType(Object) is undefined"
79 + "\nThe method or field SegmentTypeVxlan is undefined"
80 + "\nThe method segmentationId(Long) is undefined"
81 + "\nThe method macTimeout(long) is undefined"
82 + "\n>> cannot be resolved");
85 public static Object createElanInstance(final String elan, final Long segmentId, final Long tag) {
86 throw new Error("Unresolved compilation problems:"
87 + "\nElanInstanceBuilder cannot be resolved."
88 + "\nThe method elanInstanceName(String) is undefined"
89 + "\nThe method description(String) is undefined"
90 + "\nThe method elanTag(Long) is undefined"
91 + "\nThe method segmentationId(Long) is undefined"
92 + "\nThe method segmentType(Object) is undefined"
93 + "\nThe method or field SegmentTypeVxlan is undefined"
94 + "\nThe method macTimeout(long) is undefined"
95 + "\n>> cannot be resolved");
98 public static Flow checkSmac(final String flowId, final InterfaceInfo interfaceInfo, final /* ElanInstance */Object elanInstance) {
99 throw new Error("Unresolved compilation problems:"
100 + "\ngetElanTag cannot be resolved");
103 public static Flow checkDmacOfSameDpn(final String flowId, final InterfaceInfo interfaceInfo, final /* ElanInstance */Object elanInstance) {
104 throw new Error("Unresolved compilation problems:"
105 + "\ngetElanTag cannot be resolved");
108 public static Flow checkDmacOfOtherDPN(final String flowId, final InterfaceInfo interfaceInfo, final TunnelInterfaceDetails tepDetails, final /* ElanInstance */Object elanInstance) {
109 throw new Error("Unresolved compilation problems:"
110 + "\ngetElanTag cannot be resolved");
113 public static Object checkEvpnAdvertiseRoute(final Long vni, final String mac, final String tepip, final String prefix, final String rd1) {
114 throw new Error("Unresolved compilation problems:"
115 + "\nNetworksBuilder cannot be resolved."
116 + "\nThe method bgpControlPlaneType(Object) is undefined"
117 + "\nThe method or field BgpControlPlaneType is undefined"
118 + "\nThe method encapType(Object) is undefined"
119 + "\nThe method or field EncapType is undefined"
120 + "\nThe method ethtag(long) is undefined"
121 + "\nThe method l2vni(Long) is undefined"
122 + "\nThe method l3vni(long) is undefined"
123 + "\nThe method label(long) is undefined"
124 + "\nThe method macaddress(String) is undefined"
125 + "\nThe method nexthop(Ipv4Address) is undefined"
126 + "\nThe method prefixLen(String) is undefined"
127 + "\nThe method rd(String) is undefined"
128 + "\n>> cannot be resolved"
129 + "\nPROTOCOLEVPN cannot be resolved"
130 + "\nVXLAN cannot be resolved");
133 public static /* Networks */Object checkEvpnWithdrawRT2DelIntf() {