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.tablefeatures;
10 import static org.junit.Assert.assertEquals;
12 import java.util.Collections;
13 import org.junit.Test;
14 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMiss;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder;
22 public class WriteActionsMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
24 public void testSerialize() {
25 final WriteActionsMiss property = new WriteActionsMissBuilder()
26 .setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight
27 .table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.miss
28 .WriteActionsMissBuilder()
29 .setAction(Collections.singletonList(new ActionBuilder()
31 .setAction(new SetNwSrcActionCaseBuilder()
37 assertProperty(property, out -> {
38 assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
39 out.skipBytes(Short.BYTES); // Skip length of set field action
44 protected Class<? extends TableFeaturePropType> getClazz() {
45 return WriteActionsMiss.class;
49 protected int getType() {
50 return TableFeaturesPropType.OFPTFPTWRITEACTIONSMISS.getIntValue();