28e8572bc4b2c90bf840dcf7c1b790d3198773f1
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / protocol / serialization / multipart / MultipartRequestGroupDescSerializerTest.java
1 /*
2  * Copyright (c) 2017 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.openflowplugin.impl.protocol.serialization.multipart;
10
11 import static org.junit.Assert.assertEquals;
12
13 import io.netty.buffer.ByteBuf;
14 import io.netty.buffer.UnpooledByteBufAllocator;
15 import org.junit.Test;
16 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
17 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
18 import org.opendaylight.openflowplugin.impl.protocol.serialization.AbstractSerializerTest;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupDesc;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.multipart.request.multipart.request.body.MultipartRequestGroupDescBuilder;
21
22 public class MultipartRequestGroupDescSerializerTest extends AbstractSerializerTest {
23     private static final MultipartRequestGroupDesc BODY = new MultipartRequestGroupDescBuilder()
24             .build();
25
26     private MultipartRequestGroupDescSerializer serializer;
27
28     @Override
29     protected void init() {
30         serializer = getRegistry().getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID,
31                 MultipartRequestGroupDesc.class)) ;
32     }
33
34     @Test
35     public void testSerialize() {
36         final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
37         serializer.serialize(BODY, out);
38         assertEquals(out.readableBytes(), 0);
39     }
40
41 }