2 * Copyright (c) 2017 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.openflowplugin.impl.protocol.serialization.multipart;
11 import static org.junit.Assert.assertEquals;
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;
22 public class MultipartRequestGroupDescSerializerTest extends AbstractSerializerTest {
23 private static final MultipartRequestGroupDesc BODY = new MultipartRequestGroupDescBuilder()
26 private MultipartRequestGroupDescSerializer serializer;
29 protected void init() {
30 serializer = getRegistry().getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID,
31 MultipartRequestGroupDesc.class)) ;
35 public void testSerialize() throws Exception {
36 final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
37 serializer.serialize(BODY, out);
38 assertEquals(out.readableBytes(), 0);