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
8 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
10 import static org.junit.Assert.assertEquals;
12 import io.netty.buffer.ByteBuf;
13 import io.netty.buffer.UnpooledByteBufAllocator;
14 import org.junit.Test;
15 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
16 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
17 import org.opendaylight.openflowplugin.impl.protocol.serialization.AbstractSerializerTest;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.request.multipart.request.body.MultipartRequestPortDesc;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.request.multipart.request.body.MultipartRequestPortDescBuilder;
21 public class MultipartRequestPortDescSerializerTest extends AbstractSerializerTest {
22 private static final MultipartRequestPortDesc BODY = new MultipartRequestPortDescBuilder()
25 private MultipartRequestPortDescSerializer serializer;
28 protected void init() {
29 serializer = getRegistry().getSerializer(new MessageTypeKey<>(EncodeConstants.OF_VERSION_1_3,
30 MultipartRequestPortDesc.class));
34 public void testSerialize() {
35 final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
36 serializer.serialize(BODY, out);
37 assertEquals(out.readableBytes(), 0);