2 * Copyright (c) 2013 Cisco Systems, Inc. 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.openflow.md.core.sal.convertor.flowflag;
10 import java.math.BigInteger;
12 import junit.framework.Assert;
14 import org.junit.Before;
15 import org.junit.Test;
16 import org.opendaylight.openflowplugin.openflow.md.OFConstants;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder;
21 * match conversion and injection test
23 public class FlowFlagReactorTest {
25 private FlowModFlags[] flowFlags;
32 flowFlags = new FlowModFlags[] {
33 new FlowModFlags(true, true, true, true, true),
34 new FlowModFlags(false, false, false, false, false),
35 new FlowModFlags(true, false, true, false, true)
40 * convert for OF-1.3, inject into {@link FlowModInputBuilder}
43 public void testMatchConvertorV13_flow() {
44 FlowModInputBuilder target = new FlowModInputBuilder();
45 for (FlowModFlags fFlag : flowFlags) {
46 target.setFlags(null);
47 FlowFlagReactor.getInstance().convert(fFlag,
48 OFConstants.OFP_VERSION_1_3, target,BigInteger.valueOf(1));
49 Assert.assertNotNull(target.getFlags());
54 * convert for OF-1.0, inject into {@link FlowModInputBuilder}
57 public void testMatchConvertorV10_flow() {
58 FlowModInputBuilder target = new FlowModInputBuilder();
59 for (FlowModFlags fFlag : flowFlags) {
60 target.setFlagsV10(null);
61 FlowFlagReactor.getInstance().convert(fFlag,
62 OFConstants.OFP_VERSION_1_0, target,BigInteger.valueOf(1));
63 Assert.assertNotNull(target.getFlagsV10());