2 * Copyright (c) 2014 Pantheon Technologies s.r.o. 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
9 package org.opendaylight.openflowjava.protocol.impl.util;
11 import java.util.List;
13 import io.netty.buffer.ByteBuf;
14 import io.netty.buffer.PooledByteBufAllocator;
16 import org.junit.Assert;
17 import org.junit.Test;
18 import org.junit.runner.RunWith;
19 import org.mockito.Mock;
20 import org.mockito.runners.MockitoJUnitRunner;
21 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
22 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
23 import org.opendaylight.yangtools.yang.binding.DataObject;
26 * @author michal.polkorab
29 @RunWith(MockitoJUnitRunner.class)
30 public class ListDeserializerTest {
32 @Mock CodeKeyMaker keyMaker;
33 @Mock DeserializerRegistry registry;
36 * Tests {@link ListDeserializer#deserializeList(short, int, ByteBuf, CodeKeyMaker, DeserializerRegistry)}
40 ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
41 List<DataObject> list = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID,
42 42, buffer, keyMaker, registry);
44 Assert.assertNull("List is not null", list);
48 * Tests {@link ListDeserializer#deserializeHeaders(short, int, ByteBuf, CodeKeyMaker, DeserializerRegistry)}
52 ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
53 List<DataObject> list = ListDeserializer.deserializeHeaders(EncodeConstants.OF13_VERSION_ID,
54 42, buffer, keyMaker, registry);
56 Assert.assertNull("List is not null", list);