OPNFLWPLUG-1032: Neon-MRI: Bump odlparent, yangtools, mdsal
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / test / java / org / opendaylight / openflowjava / nx / NiciraExtensionsRegistratorTest.java
1 /**
2  * Copyright (c) 2016, 2017 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.openflowjava.nx;
9
10 import static org.mockito.ArgumentMatchers.any;
11 import static org.mockito.ArgumentMatchers.eq;
12
13 import org.junit.Before;
14 import org.junit.Test;
15 import org.junit.runner.RunWith;
16 import org.mockito.Mock;
17 import org.mockito.Mockito;
18 import org.mockito.runners.MockitoJUnitRunner;
19 import org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey;
20 import org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey;
21 import org.opendaylight.openflowjava.nx.api.NiciraConstants;
22 import org.opendaylight.openflowjava.nx.api.NiciraExtensionCodecRegistrator;
23 import org.opendaylight.openflowjava.nx.codec.action.DecNshTtlCodec;
24 import org.opendaylight.openflowjava.nx.codec.action.DecapCodec;
25 import org.opendaylight.openflowjava.nx.codec.action.EncapCodec;
26 import org.opendaylight.openflowjava.nx.codec.action.MultipathCodec;
27 import org.opendaylight.openflowjava.nx.codec.action.OutputReg2Codec;
28 import org.opendaylight.openflowjava.nx.codec.action.OutputRegCodec;
29 import org.opendaylight.openflowjava.nx.codec.action.RegLoad2Codec;
30 import org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec;
31 import org.opendaylight.openflowjava.nx.codec.action.RegMoveCodec;
32 import org.opendaylight.openflowjava.nx.codec.action.ResubmitCodec;
33 import org.opendaylight.openflowjava.nx.codec.match.ArpOpCodec;
34 import org.opendaylight.openflowjava.nx.codec.match.ArpShaCodec;
35 import org.opendaylight.openflowjava.nx.codec.match.ArpSpaCodec;
36 import org.opendaylight.openflowjava.nx.codec.match.ArpThaCodec;
37 import org.opendaylight.openflowjava.nx.codec.match.ArpTpaCodec;
38 import org.opendaylight.openflowjava.nx.codec.match.CtMarkCodec;
39 import org.opendaylight.openflowjava.nx.codec.match.CtStateCodec;
40 import org.opendaylight.openflowjava.nx.codec.match.CtTpDstCodec;
41 import org.opendaylight.openflowjava.nx.codec.match.CtTpSrcCodec;
42 import org.opendaylight.openflowjava.nx.codec.match.CtZoneCodec;
43 import org.opendaylight.openflowjava.nx.codec.match.EthDstCodec;
44 import org.opendaylight.openflowjava.nx.codec.match.EthSrcCodec;
45 import org.opendaylight.openflowjava.nx.codec.match.EthTypeCodec;
46 import org.opendaylight.openflowjava.nx.codec.match.NshFlagsCodec;
47 import org.opendaylight.openflowjava.nx.codec.match.NshMdtypeCodec;
48 import org.opendaylight.openflowjava.nx.codec.match.NshNpCodec;
49 import org.opendaylight.openflowjava.nx.codec.match.NshTtlCodec;
50 import org.opendaylight.openflowjava.nx.codec.match.Nshc1Codec;
51 import org.opendaylight.openflowjava.nx.codec.match.Nshc2Codec;
52 import org.opendaylight.openflowjava.nx.codec.match.Nshc3Codec;
53 import org.opendaylight.openflowjava.nx.codec.match.Nshc4Codec;
54 import org.opendaylight.openflowjava.nx.codec.match.NsiCodec;
55 import org.opendaylight.openflowjava.nx.codec.match.NspCodec;
56 import org.opendaylight.openflowjava.nx.codec.match.PktMarkCodec;
57 import org.opendaylight.openflowjava.nx.codec.match.Reg0Codec;
58 import org.opendaylight.openflowjava.nx.codec.match.Reg1Codec;
59 import org.opendaylight.openflowjava.nx.codec.match.Reg2Codec;
60 import org.opendaylight.openflowjava.nx.codec.match.Reg3Codec;
61 import org.opendaylight.openflowjava.nx.codec.match.Reg4Codec;
62 import org.opendaylight.openflowjava.nx.codec.match.Reg5Codec;
63 import org.opendaylight.openflowjava.nx.codec.match.Reg6Codec;
64 import org.opendaylight.openflowjava.nx.codec.match.Reg7Codec;
65 import org.opendaylight.openflowjava.nx.codec.match.TcpDstCodec;
66 import org.opendaylight.openflowjava.nx.codec.match.TcpSrcCodec;
67 import org.opendaylight.openflowjava.nx.codec.match.TunIdCodec;
68 import org.opendaylight.openflowjava.nx.codec.match.TunIpv4DstCodec;
69 import org.opendaylight.openflowjava.nx.codec.match.TunIpv4SrcCodec;
70 import org.opendaylight.openflowjava.nx.codec.match.UdpDstCodec;
71 import org.opendaylight.openflowjava.nx.codec.match.UdpSrcCodec;
72 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
73 import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
74 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
75 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
76 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
77 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
78 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
79 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionConntrack;
80 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionDecNshTtl;
81 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionDecap;
82 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionEncap;
83 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipath;
84 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionOutputReg;
85 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionOutputReg2;
86 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad;
87 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad2;
88 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMove;
89 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit;
90 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxArpSha;
91 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxArpTha;
92 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtMark;
93 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtState;
94 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtTpDst;
95 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtTpSrc;
96 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxCtZone;
97 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshFlags;
98 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshMdtype;
99 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshNp;
100 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshTtl;
101 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc1;
102 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc2;
103 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc3;
104 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc4;
105 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsi;
106 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsp;
107 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxPktMark;
108 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0;
109 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg1;
110 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg2;
111 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg3;
112 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg4;
113 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg5;
114 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6;
115 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg7;
116 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunId;
117 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunIpv4Dst;
118 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunIpv4Src;
119 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfArpOp;
120 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfArpSpa;
121 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfArpTpa;
122 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthDst;
123 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthSrc;
124 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthType;
125 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfTcpDst;
126 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfTcpSrc;
127 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfUdpDst;
128 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfUdpSrc;
129
130 @RunWith(MockitoJUnitRunner.class)
131 public class NiciraExtensionsRegistratorTest {
132
133     NiciraExtensionsRegistrator niciraExtensionsRegistrator;
134
135     @Mock
136     NiciraExtensionCodecRegistrator registrator;
137
138     @Before
139     public void setUp() {
140         niciraExtensionsRegistrator = new NiciraExtensionsRegistrator(registrator);
141     }
142
143     @Test
144     public void registerNiciraExtensionsTest() {
145         Mockito.verify(registrator).registerActionDeserializer(
146                 eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7)),
147                 any(RegLoadCodec.class));
148         Mockito.verify(registrator).registerActionSerializer(
149                 eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class)),
150                 any(RegLoadCodec.class));
151         Mockito.verify(registrator).registerActionDeserializer(
152                 eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 33)),
153                 any(RegLoad2Codec.class));
154         Mockito.verify(registrator).registerActionSerializer(
155                 eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad2.class)),
156                 any(RegLoad2Codec.class));
157         Mockito.verify(registrator).registerActionDeserializer(
158                 eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6)),
159                 any(RegMoveCodec.class));
160         Mockito.verify(registrator).registerActionSerializer(
161                 eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class)),
162                 any(RegMoveCodec.class));
163         Mockito.verify(registrator).registerActionDeserializer(
164                 eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15)),
165                 any(OutputRegCodec.class));
166         Mockito.verify(registrator).registerActionSerializer(
167                 eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class)),
168                 any(OutputRegCodec.class));
169         Mockito.verify(registrator).registerActionDeserializer(
170                 eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 32)),
171                 any(OutputReg2Codec.class));
172         Mockito.verify(registrator).registerActionSerializer(
173                 eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg2.class)),
174                 any(OutputReg2Codec.class));
175         Mockito.verify(registrator).registerActionSerializer(
176                 eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class)),
177                 any(ResubmitCodec.class));
178         Mockito.verify(registrator).registerActionDeserializer(
179                 eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1)),
180                 any(ResubmitCodec.class));
181         Mockito.verify(registrator).registerActionDeserializer(
182                 eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14)),
183                 any(ResubmitCodec.class));
184         Mockito.verify(registrator).registerActionSerializer(
185                 eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class)),
186                 any(MultipathCodec.class));
187         Mockito.verify(registrator).registerActionDeserializer(
188                 eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10)),
189                 any(MultipathCodec.class));
190         Mockito.verify(registrator).registerActionDeserializer(
191                 eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 46)),
192                 any(EncapCodec.class));
193         Mockito.verify(registrator).registerActionSerializer(
194                 eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionEncap.class)),
195                 any(EncapCodec.class));
196         Mockito.verify(registrator).registerActionDeserializer(
197                 eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 47)),
198                 any(DecapCodec.class));
199         Mockito.verify(registrator).registerActionSerializer(
200                 eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionDecap.class)),
201                 any(DecapCodec.class));
202         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
203                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class)),
204                 any(Reg0Codec.class));
205         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
206                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0)),
207                 any(Reg0Codec.class));
208         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
209                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class)),
210                 any(Reg1Codec.class));
211         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
212                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1)),
213                 any(Reg1Codec.class));
214         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
215                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class)),
216                 any(Reg2Codec.class));
217         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
218                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2)),
219                 any(Reg2Codec.class));
220         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
221                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class)),
222                 any(Reg3Codec.class));
223         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
224                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3)),
225                 any(Reg3Codec.class));
226         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
227                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class)),
228                 any(Reg4Codec.class));
229         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
230                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4)),
231                 any(Reg4Codec.class));
232         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
233                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class)),
234                 any(Reg5Codec.class));
235         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
236                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5)),
237                 any(Reg5Codec.class));
238         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
239                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class)),
240                 any(Reg6Codec.class));
241         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
242                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6)),
243                 any(Reg6Codec.class));
244         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
245                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class)),
246                 any(Reg7Codec.class));
247         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
248                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7)),
249                 any(Reg7Codec.class));
250         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
251                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class)),
252                 any(TunIdCodec.class));
253         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
254                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16)),
255                 any(TunIdCodec.class));
256         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
257                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class)),
258                 any(ArpOpCodec.class));
259         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
260                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15)),
261                 any(ArpOpCodec.class));
262         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
263                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class)),
264                 any(ArpShaCodec.class));
265         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
266                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17)),
267                 any(ArpShaCodec.class));
268         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
269                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class)),
270                 any(ArpSpaCodec.class));
271         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
272                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16)),
273                 any(ArpSpaCodec.class));
274         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
275                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class)),
276                 any(ArpThaCodec.class));
277         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
278                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18)),
279                 any(ArpThaCodec.class));
280         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
281                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class)),
282                 any(ArpTpaCodec.class));
283         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
284                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17)),
285                 any(ArpTpaCodec.class));
286         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
287                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class)),
288                 any(EthDstCodec.class));
289         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
290                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1)),
291                 any(EthDstCodec.class));
292         Mockito.verify(registrator).registerMatchEntrySerializer(
293                 eq(new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class)),
294                 any(EthSrcCodec.class));
295         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
296                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2)),
297                 any(EthSrcCodec.class));
298         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
299                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthType.class)),
300                 any(EthTypeCodec.class));
301         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
302                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3)),
303                 any(EthTypeCodec.class));
304         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
305                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class)),
306                 any(TunIpv4DstCodec.class));
307         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
308                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32)),
309                 any(TunIpv4DstCodec.class));
310         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
311                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class)),
312                 any(TunIpv4SrcCodec.class));
313         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
314                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31)),
315                 any(TunIpv4SrcCodec.class));
316         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
317                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class)),
318                 any(TcpSrcCodec.class));
319         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
320                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9)),
321                 any(TcpSrcCodec.class));
322         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
323                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class)),
324                 any(TcpDstCodec.class));
325         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
326                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10)),
327                 any(TcpDstCodec.class));
328         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
329                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class)),
330                 any(UdpSrcCodec.class));
331         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
332                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11)),
333                 any(UdpSrcCodec.class));
334         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
335                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class)),
336                 any(UdpDstCodec.class));
337         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
338                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12)),
339                 any(UdpDstCodec.class));
340         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
341                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtState.class)),
342                 any(CtStateCodec.class));
343         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
344                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105)),
345                 any(CtStateCodec.class));
346         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
347                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class)),
348                 any(CtZoneCodec.class));
349         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
350                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106)),
351                 any(CtZoneCodec.class));
352         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
353                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class)),
354                 any(CtMarkCodec.class));
355         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
356                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107)),
357                 any(CtMarkCodec.class));
358         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
359                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class,
360                                 NxmNxCtTpSrc.class)), any(CtTpSrcCodec.class));
361         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
362                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
363                                 OxmMatchConstants.NXM_1_CLASS, 124)), any(CtTpSrcCodec.class));
364         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
365                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class,
366                                 NxmNxCtTpDst.class)), any(CtTpDstCodec.class));
367         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
368                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
369                                 OxmMatchConstants.NXM_1_CLASS, 125)), any(CtTpDstCodec.class));
370         Mockito.verify(registrator).registerMatchEntrySerializer(eq(
371                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class,
372                         NxmNxPktMark.class)), any(PktMarkCodec.class));
373         Mockito.verify(registrator).registerMatchEntryDeserializer(eq(
374                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
375                         OxmMatchConstants.NXM_1_CLASS, 33)), any(PktMarkCodec.class));
376         Mockito.verify(registrator).registerActionDeserializer(
377                 eq(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 48)),
378                 any(DecNshTtlCodec.class));
379         Mockito.verify(registrator).registerActionSerializer(
380                 eq(new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionDecNshTtl.class)),
381                 any(DecNshTtlCodec.class));
382
383         // experimenters
384         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshFlags> nshFlagsSerializerKey = new MatchEntrySerializerKey<>(
385                 EncodeConstants.OF13_VERSION_ID,
386                 ExperimenterClass.class,
387                 NxmNxNshFlags.class);
388         nshFlagsSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
389         Mockito.verify(registrator).registerMatchEntrySerializer(
390                 eq(nshFlagsSerializerKey),
391                 any(NshFlagsCodec.class));
392         MatchEntryDeserializerKey nshFlagsDeserializerKey = new MatchEntryDeserializerKey(
393                 EncodeConstants.OF13_VERSION_ID,
394                 OxmMatchConstants.EXPERIMENTER_CLASS,
395                 1);
396         nshFlagsDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
397         Mockito.verify(registrator).registerMatchEntryDeserializer(
398                 eq(nshFlagsDeserializerKey),
399                 any(NshFlagsCodec.class));
400         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshMdtype> mdtypeSerializerKey = new MatchEntrySerializerKey<>(
401                 EncodeConstants.OF13_VERSION_ID,
402                 ExperimenterClass.class,
403                 NxmNxNshMdtype.class);
404         mdtypeSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
405         Mockito.verify(registrator).registerMatchEntrySerializer(
406                 eq(mdtypeSerializerKey),
407                 any(NshMdtypeCodec.class));
408         MatchEntryDeserializerKey mdtypeDeserializerKey = new MatchEntryDeserializerKey(
409                 EncodeConstants.OF13_VERSION_ID,
410                 OxmMatchConstants.EXPERIMENTER_CLASS,
411                 2);
412         mdtypeDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
413         Mockito.verify(registrator).registerMatchEntryDeserializer(
414                 eq(mdtypeDeserializerKey),
415                 any(NshMdtypeCodec.class));
416         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshNp> nshNpSerializerKey = new MatchEntrySerializerKey<>(
417                 EncodeConstants.OF13_VERSION_ID,
418                 ExperimenterClass.class,
419                 NxmNxNshNp.class);
420         nshNpSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
421         Mockito.verify(registrator).registerMatchEntrySerializer(
422                 eq(nshNpSerializerKey),
423                 any(NshNpCodec.class));
424         MatchEntryDeserializerKey nshNpDeserializerKey = new MatchEntryDeserializerKey(
425                 EncodeConstants.OF13_VERSION_ID,
426                 OxmMatchConstants.EXPERIMENTER_CLASS,
427                 3);
428         nshNpDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
429         Mockito.verify(registrator).registerMatchEntryDeserializer(
430                 eq(nshNpDeserializerKey),
431                 any(NshNpCodec.class));
432         MatchEntrySerializerKey<ExperimenterClass, NxmNxNsp> nspSerializerKey = new MatchEntrySerializerKey<>(
433                 EncodeConstants.OF13_VERSION_ID,
434                 ExperimenterClass.class,
435                 NxmNxNsp.class);
436         nspSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
437         Mockito.verify(registrator).registerMatchEntrySerializer(
438                 eq(nspSerializerKey),
439                 any(NspCodec.class));
440         MatchEntryDeserializerKey nspDeserializerKey = new MatchEntryDeserializerKey(
441                 EncodeConstants.OF13_VERSION_ID,
442                 OxmMatchConstants.EXPERIMENTER_CLASS,
443                 4);
444         nspDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
445         Mockito.verify(registrator).registerMatchEntryDeserializer(
446                 eq(nspDeserializerKey),
447                 any(NspCodec.class));
448         MatchEntrySerializerKey<ExperimenterClass, NxmNxNsi> nsiSerializerKey = new MatchEntrySerializerKey<>(
449                 EncodeConstants.OF13_VERSION_ID,
450                 ExperimenterClass.class,
451                 NxmNxNsi.class);
452         nsiSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
453         Mockito.verify(registrator).registerMatchEntrySerializer(
454                 eq(nsiSerializerKey),
455                 any(NsiCodec.class));
456         MatchEntryDeserializerKey nsiDeserializerKey = new MatchEntryDeserializerKey(
457                 EncodeConstants.OF13_VERSION_ID,
458                 OxmMatchConstants.EXPERIMENTER_CLASS,
459                 5);
460         nsiDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
461         Mockito.verify(registrator).registerMatchEntryDeserializer(
462                 eq(nsiDeserializerKey),
463                 any(NsiCodec.class));
464         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc1> nshc1SerializerKey = new MatchEntrySerializerKey<>(
465                 EncodeConstants.OF13_VERSION_ID,
466                 ExperimenterClass.class,
467                 NxmNxNshc1.class);
468         nshc1SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
469         Mockito.verify(registrator).registerMatchEntrySerializer(
470                 eq(nshc1SerializerKey),
471                 any(Nshc1Codec.class));
472         MatchEntryDeserializerKey nshc1DeserializerKey = new MatchEntryDeserializerKey(
473                 EncodeConstants.OF13_VERSION_ID,
474                 OxmMatchConstants.EXPERIMENTER_CLASS,
475                 6);
476         nshc1DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
477         Mockito.verify(registrator).registerMatchEntryDeserializer(
478                 eq(nshc1DeserializerKey),
479                 any(Nshc1Codec.class));
480         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc2> nshc2SerializerKey = new MatchEntrySerializerKey<>(
481                 EncodeConstants.OF13_VERSION_ID,
482                 ExperimenterClass.class,
483                 NxmNxNshc2.class);
484         nshc2SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
485         Mockito.verify(registrator).registerMatchEntrySerializer(
486                 eq(nshc2SerializerKey),
487                 any(Nshc2Codec.class));
488         MatchEntryDeserializerKey nshc2DeserializerKey = new MatchEntryDeserializerKey(
489                 EncodeConstants.OF13_VERSION_ID,
490                 OxmMatchConstants.EXPERIMENTER_CLASS,
491                 7);
492         nshc2DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
493         Mockito.verify(registrator).registerMatchEntryDeserializer(
494                 eq(nshc2DeserializerKey),
495                 any(Nshc2Codec.class));
496         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc3> nshc3SerializerKey = new MatchEntrySerializerKey<>(
497                 EncodeConstants.OF13_VERSION_ID,
498                 ExperimenterClass.class,
499                 NxmNxNshc3.class);
500         nshc3SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
501         Mockito.verify(registrator).registerMatchEntrySerializer(
502                 eq(nshc3SerializerKey),
503                 any(Nshc3Codec.class));
504         MatchEntryDeserializerKey nshc3DeserializerKey = new MatchEntryDeserializerKey(
505                 EncodeConstants.OF13_VERSION_ID,
506                 OxmMatchConstants.EXPERIMENTER_CLASS,
507                 8);
508         nshc3DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
509         Mockito.verify(registrator).registerMatchEntryDeserializer(
510                 eq(nshc3DeserializerKey),
511                 any(Nshc3Codec.class));
512         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc4> nshc4SerializerKey = new MatchEntrySerializerKey<>(
513                 EncodeConstants.OF13_VERSION_ID,
514                 ExperimenterClass.class,
515                 NxmNxNshc4.class);
516         nshc4SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
517         Mockito.verify(registrator).registerMatchEntrySerializer(
518                 eq(nshc4SerializerKey),
519                 any(Nshc4Codec.class));
520         MatchEntryDeserializerKey nshc4DeserializerKey = new MatchEntryDeserializerKey(
521                 EncodeConstants.OF13_VERSION_ID,
522                 OxmMatchConstants.EXPERIMENTER_CLASS,
523                 9);
524         nshc4DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
525         Mockito.verify(registrator).registerMatchEntryDeserializer(
526                 eq(nshc4DeserializerKey),
527                 any(Nshc4Codec.class));
528         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshTtl> nshTtlSerializerKey = new MatchEntrySerializerKey<>(
529                 EncodeConstants.OF13_VERSION_ID,
530                 ExperimenterClass.class,
531                 NxmNxNshTtl.class);
532         nshTtlSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
533         Mockito.verify(registrator).registerMatchEntrySerializer(
534                 eq(nshTtlSerializerKey),
535                 any(NshTtlCodec.class));
536         MatchEntryDeserializerKey nshTtlDeserializerKey = new MatchEntryDeserializerKey(
537                 EncodeConstants.OF13_VERSION_ID,
538                 OxmMatchConstants.EXPERIMENTER_CLASS,
539                 10);
540         nshTtlDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
541         Mockito.verify(registrator).registerMatchEntryDeserializer(
542                 eq(nshTtlDeserializerKey),
543                 any(NshTtlCodec.class));
544     }
545
546     @Test
547     public void unregisterExtensionsTest() throws Exception {
548         niciraExtensionsRegistrator.close();
549
550         Mockito.verify(registrator)
551                 .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 7));
552         Mockito.verify(registrator).unregisterActionSerializer(
553                 new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad.class));
554         Mockito.verify(registrator)
555                 .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 33));
556         Mockito.verify(registrator).unregisterActionSerializer(
557                 new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegLoad2.class));
558         Mockito.verify(registrator)
559                 .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 6));
560         Mockito.verify(registrator).unregisterActionSerializer(
561                 new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionRegMove.class));
562         Mockito.verify(registrator)
563                 .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 15));
564         Mockito.verify(registrator).unregisterActionSerializer(
565                 new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg.class));
566         Mockito.verify(registrator)
567                 .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 32));
568         Mockito.verify(registrator).unregisterActionSerializer(
569                 new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionOutputReg2.class));
570         Mockito.verify(registrator)
571                 .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 1));
572         Mockito.verify(registrator)
573                 .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 14));
574         Mockito.verify(registrator).unregisterActionSerializer(
575                 new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionResubmit.class));
576         Mockito.verify(registrator)
577                 .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 10));
578         Mockito.verify(registrator).unregisterActionSerializer(
579                 new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionMultipath.class));
580         Mockito.verify(registrator).unregisterActionSerializer(
581                 new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionConntrack.class));
582         Mockito.verify(registrator)
583                 .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 46));
584         Mockito.verify(registrator).unregisterActionSerializer(
585                 new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionEncap.class));
586         Mockito.verify(registrator)
587                 .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 47));
588         Mockito.verify(registrator).unregisterActionSerializer(
589                 new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionDecap.class));
590         Mockito.verify(registrator)
591                 .unregisterActionDeserializer(new NiciraActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 48));
592         Mockito.verify(registrator).unregisterActionSerializer(
593                 new NiciraActionSerializerKey(EncodeConstants.OF13_VERSION_ID, ActionDecNshTtl.class));
594         Mockito.verify(registrator).unregisterMatchEntrySerializer(
595                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg0.class));
596         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
597                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 0));
598         Mockito.verify(registrator).unregisterMatchEntrySerializer(
599                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg1.class));
600         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
601                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 1));
602         Mockito.verify(registrator).unregisterMatchEntrySerializer(
603                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg2.class));
604         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
605                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 2));
606         Mockito.verify(registrator).unregisterMatchEntrySerializer(
607                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg3.class));
608         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
609                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 3));
610         Mockito.verify(registrator).unregisterMatchEntrySerializer(
611                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg4.class));
612         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
613                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 4));
614         Mockito.verify(registrator).unregisterMatchEntrySerializer(
615                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg5.class));
616         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
617                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 5));
618         Mockito.verify(registrator).unregisterMatchEntrySerializer(
619                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg6.class));
620         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
621                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 6));
622         Mockito.verify(registrator).unregisterMatchEntrySerializer(
623                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxReg7.class));
624         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
625                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 7));
626         Mockito.verify(registrator).unregisterMatchEntrySerializer(
627                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunId.class));
628         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
629                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 16));
630         Mockito.verify(registrator).unregisterMatchEntrySerializer(
631                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpOp.class));
632         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
633                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 15));
634         Mockito.verify(registrator).unregisterMatchEntrySerializer(
635                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpSha.class));
636         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
637                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 17));
638         Mockito.verify(registrator).unregisterMatchEntrySerializer(
639                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpSpa.class));
640         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
641                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 16));
642         Mockito.verify(registrator).unregisterMatchEntrySerializer(
643                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxArpTha.class));
644         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
645                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 18));
646         Mockito.verify(registrator).unregisterMatchEntrySerializer(
647                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfArpTpa.class));
648         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
649                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 17));
650         Mockito.verify(registrator).unregisterMatchEntrySerializer(
651                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthDst.class));
652         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
653                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 1));
654         Mockito.verify(registrator).unregisterMatchEntrySerializer(
655                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthSrc.class));
656         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
657                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 2));
658         Mockito.verify(registrator).unregisterMatchEntrySerializer(
659                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfEthType.class));
660         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
661                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 3));
662         Mockito.verify(registrator).unregisterMatchEntrySerializer(
663                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Dst.class));
664         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
665                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 32));
666         Mockito.verify(registrator).unregisterMatchEntrySerializer(
667                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxTunIpv4Src.class));
668         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
669                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 31));
670         Mockito.verify(registrator).unregisterMatchEntrySerializer(
671                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpSrc.class));
672         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
673                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 9));
674         Mockito.verify(registrator).unregisterMatchEntrySerializer(
675                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfTcpDst.class));
676         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
677                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 10));
678         Mockito.verify(registrator).unregisterMatchEntrySerializer(
679                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpSrc.class));
680         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
681                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 11));
682         Mockito.verify(registrator).unregisterMatchEntrySerializer(
683                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm0Class.class, NxmOfUdpDst.class));
684         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
685                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_0_CLASS, 12));
686         Mockito.verify(registrator).unregisterMatchEntrySerializer(
687                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtState.class));
688         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
689                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 105));
690         Mockito.verify(registrator).unregisterMatchEntrySerializer(
691                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtZone.class));
692         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
693                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 106));
694         Mockito.verify(registrator).unregisterMatchEntrySerializer(
695                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtMark.class));
696         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
697                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 107));
698         Mockito.verify(registrator).unregisterMatchEntrySerializer(
699                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtTpSrc.class));
700         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
701                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 124));
702         Mockito.verify(registrator).unregisterMatchEntrySerializer(
703                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxCtTpDst.class));
704         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
705                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 125));
706         Mockito.verify(registrator).unregisterMatchEntrySerializer(
707                 new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, Nxm1Class.class, NxmNxPktMark.class));
708         Mockito.verify(registrator).unregisterMatchEntryDeserializer(
709                 new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, OxmMatchConstants.NXM_1_CLASS, 33));
710
711         // experimenters
712         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshFlags> nshFlagsSerializerKey = new MatchEntrySerializerKey<>(
713                 EncodeConstants.OF13_VERSION_ID,
714                 ExperimenterClass.class,
715                 NxmNxNshFlags.class);
716         nshFlagsSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
717         Mockito.verify(registrator).unregisterMatchEntrySerializer(nshFlagsSerializerKey);
718         MatchEntryDeserializerKey nshFlagsDeserializerKey = new MatchEntryDeserializerKey(
719                 EncodeConstants.OF13_VERSION_ID,
720                 OxmMatchConstants.EXPERIMENTER_CLASS,
721                 1);
722         nshFlagsDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
723         Mockito.verify(registrator).unregisterMatchEntryDeserializer(nshFlagsDeserializerKey);
724         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshMdtype> mdtypeSerializerKey = new MatchEntrySerializerKey<>(
725                 EncodeConstants.OF13_VERSION_ID,
726                 ExperimenterClass.class,
727                 NxmNxNshMdtype.class);
728         mdtypeSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
729         Mockito.verify(registrator).unregisterMatchEntrySerializer(mdtypeSerializerKey);
730         MatchEntryDeserializerKey mdtypeDeserializerKey = new MatchEntryDeserializerKey(
731                 EncodeConstants.OF13_VERSION_ID,
732                 OxmMatchConstants.EXPERIMENTER_CLASS,
733                 2);
734         mdtypeDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
735         Mockito.verify(registrator).unregisterMatchEntryDeserializer(mdtypeDeserializerKey);
736         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshNp> nshNpSerializerKey = new MatchEntrySerializerKey<>(
737                 EncodeConstants.OF13_VERSION_ID,
738                 ExperimenterClass.class,
739                 NxmNxNshNp.class);
740         nshNpSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
741         Mockito.verify(registrator).unregisterMatchEntrySerializer(nshNpSerializerKey);
742         MatchEntryDeserializerKey nshNpDeserializerKey = new MatchEntryDeserializerKey(
743                 EncodeConstants.OF13_VERSION_ID,
744                 OxmMatchConstants.EXPERIMENTER_CLASS,
745                 3);
746         nshNpDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
747         Mockito.verify(registrator).unregisterMatchEntryDeserializer(nshNpDeserializerKey);
748         MatchEntrySerializerKey<ExperimenterClass, NxmNxNsp> nspSerializerKey = new MatchEntrySerializerKey<>(
749                 EncodeConstants.OF13_VERSION_ID,
750                 ExperimenterClass.class,
751                 NxmNxNsp.class);
752         nspSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
753         Mockito.verify(registrator).unregisterMatchEntrySerializer(nspSerializerKey);
754         MatchEntryDeserializerKey nspDeserializerKey = new MatchEntryDeserializerKey(
755                 EncodeConstants.OF13_VERSION_ID,
756                 OxmMatchConstants.EXPERIMENTER_CLASS,
757                 4);
758         nspDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
759         Mockito.verify(registrator).unregisterMatchEntryDeserializer(nspDeserializerKey);
760         MatchEntrySerializerKey<ExperimenterClass, NxmNxNsi> nsiSerializerKey = new MatchEntrySerializerKey<>(
761                 EncodeConstants.OF13_VERSION_ID,
762                 ExperimenterClass.class,
763                 NxmNxNsi.class);
764         nsiSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
765         Mockito.verify(registrator).unregisterMatchEntrySerializer(nsiSerializerKey);
766         MatchEntryDeserializerKey nsiDeserializerKey = new MatchEntryDeserializerKey(
767                 EncodeConstants.OF13_VERSION_ID,
768                 OxmMatchConstants.EXPERIMENTER_CLASS,
769                 5);
770         nsiDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
771         Mockito.verify(registrator).unregisterMatchEntryDeserializer(nsiDeserializerKey);
772         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc1> nshc1SerializerKey = new MatchEntrySerializerKey<>(
773                 EncodeConstants.OF13_VERSION_ID,
774                 ExperimenterClass.class,
775                 NxmNxNshc1.class);
776         nshc1SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
777         Mockito.verify(registrator).unregisterMatchEntrySerializer(nshc1SerializerKey);
778         MatchEntryDeserializerKey nshc1DeserializerKey = new MatchEntryDeserializerKey(
779                 EncodeConstants.OF13_VERSION_ID,
780                 OxmMatchConstants.EXPERIMENTER_CLASS,
781                 6);
782         nshc1DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
783         Mockito.verify(registrator).unregisterMatchEntryDeserializer(nshc1DeserializerKey);
784         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc2> nshc2SerializerKey = new MatchEntrySerializerKey<>(
785                 EncodeConstants.OF13_VERSION_ID,
786                 ExperimenterClass.class,
787                 NxmNxNshc2.class);
788         nshc2SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
789         Mockito.verify(registrator).unregisterMatchEntrySerializer(nshc2SerializerKey);
790         MatchEntryDeserializerKey nshc2DeserializerKey = new MatchEntryDeserializerKey(
791                 EncodeConstants.OF13_VERSION_ID,
792                 OxmMatchConstants.EXPERIMENTER_CLASS,
793                 7);
794         nshc2DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
795         Mockito.verify(registrator).unregisterMatchEntryDeserializer(nshc2DeserializerKey);
796         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc3> nshc3SerializerKey = new MatchEntrySerializerKey<>(
797                 EncodeConstants.OF13_VERSION_ID,
798                 ExperimenterClass.class,
799                 NxmNxNshc3.class);
800         nshc3SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
801         Mockito.verify(registrator).unregisterMatchEntrySerializer(nshc3SerializerKey);
802         MatchEntryDeserializerKey nshc3DeserializerKey = new MatchEntryDeserializerKey(
803                 EncodeConstants.OF13_VERSION_ID,
804                 OxmMatchConstants.EXPERIMENTER_CLASS,
805                 8);
806         nshc3DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
807         Mockito.verify(registrator).unregisterMatchEntryDeserializer(nshc3DeserializerKey);
808         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshc4> nshc4SerializerKey = new MatchEntrySerializerKey<>(
809                 EncodeConstants.OF13_VERSION_ID,
810                 ExperimenterClass.class,
811                 NxmNxNshc4.class);
812         nshc4SerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
813         Mockito.verify(registrator).unregisterMatchEntrySerializer(nshc1SerializerKey);
814         MatchEntryDeserializerKey nshc4DeserializerKey = new MatchEntryDeserializerKey(
815                 EncodeConstants.OF13_VERSION_ID,
816                 OxmMatchConstants.EXPERIMENTER_CLASS,
817                 9);
818         nshc4DeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
819         Mockito.verify(registrator).unregisterMatchEntryDeserializer(nshc4DeserializerKey);
820         MatchEntrySerializerKey<ExperimenterClass, NxmNxNshTtl> nshTtlSerializerKey = new MatchEntrySerializerKey<>(
821                 EncodeConstants.OF13_VERSION_ID,
822                 ExperimenterClass.class,
823                 NxmNxNshTtl.class);
824         nshTtlSerializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
825         Mockito.verify(registrator).unregisterMatchEntrySerializer(nshTtlSerializerKey);
826         MatchEntryDeserializerKey nshTtlDeserializerKey = new MatchEntryDeserializerKey(
827                 EncodeConstants.OF13_VERSION_ID,
828                 OxmMatchConstants.EXPERIMENTER_CLASS,
829                 10);
830         nshTtlDeserializerKey.setExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID);
831         Mockito.verify(registrator).unregisterMatchEntryDeserializer(nshTtlDeserializerKey);
832     }
833 }