Fix codestyle
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / protocol / serialization / multipart / tablefeatures / NextTableMissTablePropertySerializerTest.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.tablefeatures;
10
11 import static org.junit.Assert.assertEquals;
12
13 import java.util.Collections;
14 import org.junit.Test;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMiss;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMissBuilder;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.next.table.miss.TablesMissBuilder;
20
21 public class NextTableMissTablePropertySerializerTest extends AbstractTablePropertySerializerTest {
22
23     @Test
24     public void testSerialize() throws Exception {
25         final short tableId = 42;
26         final NextTableMiss property = new NextTableMissBuilder()
27                 .setTablesMiss(new TablesMissBuilder()
28                         .setTableIds(Collections.singletonList(tableId))
29                         .build())
30                 .build();
31
32         assertProperty(property, out -> assertEquals(out.readUnsignedByte(), tableId));
33     }
34
35     @Override
36     protected Class<? extends TableFeaturePropType> getClazz() {
37         return NextTableMiss.class;
38     }
39
40     @Override
41     protected int getType() {
42         return TableFeaturesPropType.OFPTFPTNEXTTABLESMISS.getIntValue();
43     }
44
45 }