Mass replace CRLF->LF
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / util / ListDeserializerTest.java
1 /*
2  * Copyright (c) 2014 Pantheon Technologies s.r.o. 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
9 package org.opendaylight.openflowjava.protocol.impl.util;
10
11 import java.util.List;
12
13 import io.netty.buffer.ByteBuf;
14 import io.netty.buffer.PooledByteBufAllocator;
15
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;
24
25 /**
26  * @author michal.polkorab
27  *
28  */
29 @RunWith(MockitoJUnitRunner.class)
30 public class ListDeserializerTest {
31
32     @Mock CodeKeyMaker keyMaker;
33     @Mock DeserializerRegistry registry;
34
35     /**
36      * Tests {@link ListDeserializer#deserializeList(short, int, ByteBuf, CodeKeyMaker, DeserializerRegistry)}
37      */
38     @Test
39     public void test() {
40         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
41         List<DataObject> list = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID,
42                 42, buffer, keyMaker, registry);
43
44         Assert.assertNull("List is not null", list);
45     }
46
47     /**
48      * Tests {@link ListDeserializer#deserializeHeaders(short, int, ByteBuf, CodeKeyMaker, DeserializerRegistry)}
49      */
50     @Test
51     public void test2() {
52         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
53         List<DataObject> list = ListDeserializer.deserializeHeaders(EncodeConstants.OF13_VERSION_ID,
54                 42, buffer, keyMaker, registry);
55
56         Assert.assertNull("List is not null", list);
57     }
58 }