2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
9 package org.opendaylight.openflowjava.protocol.impl.util;
\r
11 import java.util.List;
\r
13 import io.netty.buffer.ByteBuf;
\r
14 import io.netty.buffer.PooledByteBufAllocator;
\r
16 import org.junit.Assert;
\r
17 import org.junit.Test;
\r
18 import org.junit.runner.RunWith;
\r
19 import org.mockito.Mock;
\r
20 import org.mockito.runners.MockitoJUnitRunner;
\r
21 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
\r
22 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
\r
23 import org.opendaylight.yangtools.yang.binding.DataObject;
\r
26 * @author michal.polkorab
\r
29 @RunWith(MockitoJUnitRunner.class)
\r
30 public class ListDeserializerTest {
\r
32 @Mock CodeKeyMaker keyMaker;
\r
33 @Mock DeserializerRegistry registry;
\r
36 * Tests {@link ListDeserializer#deserializeList(short, int, ByteBuf, CodeKeyMaker, DeserializerRegistry)}
\r
39 public void test() {
\r
40 ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
\r
41 List<DataObject> list = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID,
\r
42 42, buffer, keyMaker, registry);
\r
44 Assert.assertNull("List is not null", list);
\r
48 * Tests {@link ListDeserializer#deserializeHeaders(short, int, ByteBuf, CodeKeyMaker, DeserializerRegistry)}
\r
51 public void test2() {
\r
52 ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
\r
53 List<DataObject> list = ListDeserializer.deserializeHeaders(EncodeConstants.OF13_VERSION_ID,
\r
54 42, buffer, keyMaker, registry);
\r
56 Assert.assertNull("List is not null", list);
\r