2 * Copyright (c) 2016 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.actions;
10 import static org.junit.Assert.assertEquals;
12 import org.junit.Test;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.IetfYangUtil;
14 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCase;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder;
20 public class SetDlSrcActionSerializerTest extends AbstractSetFieldActionSerializerTest {
22 public void testSerialize() {
23 final MacAddress address = new MacAddress("00:01:02:03:04:05");
25 final Action action = new SetDlSrcActionCaseBuilder()
26 .setSetDlSrcAction(new SetDlSrcActionBuilder()
31 assertAction(action, out -> {
32 byte[] addressBytes = new byte[6];
33 out.readBytes(addressBytes);
34 assertEquals(address, IetfYangUtil.macAddressFor(addressBytes));
39 protected Class<? extends Action> getClazz() {
40 return SetDlSrcActionCase.class;