X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcompatibility%2Fsal-compatibility%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcompatibility%2Ftest%2FMDFlowMappingTest.java;fp=opendaylight%2Fmd-sal%2Fcompatibility%2Fsal-compatibility%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcompatibility%2Ftest%2FMDFlowMappingTest.java;h=0000000000000000000000000000000000000000;hb=8644c0d5f1b10c02f68702f023c07ea939885176;hp=2490ace648cd37436a710831142e219534587fdd;hpb=fdda2ebadfe3729e21448fe8f44a506aa67b5da9;p=controller.git diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/MDFlowMappingTest.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/MDFlowMappingTest.java deleted file mode 100644 index 2490ace648..0000000000 --- a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/MDFlowMappingTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.sal.compatibility.test; - -import org.junit.Assert; -import org.junit.Test; -import org.opendaylight.controller.sal.action.Action; -import org.opendaylight.controller.sal.action.PushVlan; -import org.opendaylight.controller.sal.compatibility.MDFlowMapping; -import org.opendaylight.controller.sal.core.ConstructionException; -import org.opendaylight.controller.sal.core.Node; -import org.opendaylight.controller.sal.core.Node.NodeIDType; -import org.opendaylight.controller.sal.core.NodeConnector; -import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType; -import org.opendaylight.controller.sal.utils.EtherTypes; - -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri; -import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase; - -/** - * test for {@link MDFlowMapping} - */ -public class MDFlowMappingTest { - - /** - * Test method for {@link org.opendaylight.controller.sal.compatibility.MDFlowMapping#toUri(org.opendaylight.controller.sal.core.NodeConnector)}. - * @throws ConstructionException - */ - @Test - public void testToUri() throws ConstructionException { - Node node = new Node(NodeIDType.OPENFLOW, 41L); - NodeConnector connector = new NodeConnector(NodeConnectorIDType.OPENFLOW, (short) 42, node); - Uri observed = MDFlowMapping.toUri(connector ); - - Assert.assertEquals("openflow:41:42", observed.getValue()); - } - - /** - * Test method for {@link MDFlowMapping#toAction(Action, int)}. - */ - @Test - public void testToAction() { - // PUSH_VLAN test. - EtherTypes[] tags = {EtherTypes.VLANTAGGED, EtherTypes.QINQ}; - int order = 0; - for (EtherTypes tag: tags) { - Action action = new PushVlan(tag); - org.opendaylight.yang.gen.v1.urn.opendaylight.action.types. - rev131112.action.list.Action mdActionList = - MDFlowMapping.toAction(action, order); - Assert.assertEquals(order, mdActionList.getOrder().intValue()); - - org.opendaylight.yang.gen.v1.urn.opendaylight.action.types. - rev131112.action.Action mdAction = mdActionList.getAction(); - Assert.assertTrue(mdAction instanceof PushVlanActionCase); - PushVlanActionCase pushVlan = (PushVlanActionCase)mdAction; - Assert.assertEquals(tag.intValue(), - pushVlan.getPushVlanAction().getEthernetType(). - intValue()); - order++; - } - } -}