4e5f318d4c479711b137cce98d4b59ad6cda33d9
[controller.git] / opendaylight / md-sal / compatibility / sal-compatibility / src / test / java / org / opendaylight / controller / sal / compatibility / test / MDFlowMappingTest.java
1 /**
2  * Copyright (c) 2014 Cisco Systems, Inc. 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 package org.opendaylight.controller.sal.compatibility.test;
9
10 import junit.framework.Assert;
11
12 import org.junit.Test;
13 import org.opendaylight.controller.sal.compatibility.MDFlowMapping;
14 import org.opendaylight.controller.sal.core.ConstructionException;
15 import org.opendaylight.controller.sal.core.Node;
16 import org.opendaylight.controller.sal.core.Node.NodeIDType;
17 import org.opendaylight.controller.sal.core.NodeConnector;
18 import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
19 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
20
21 /**
22  * test for {@link MDFlowMapping}
23  */
24 public class MDFlowMappingTest {
25
26     /**
27      * Test method for {@link org.opendaylight.controller.sal.compatibility.MDFlowMapping#toUri(org.opendaylight.controller.sal.core.NodeConnector)}.
28      * @throws ConstructionException
29      */
30     @Test
31     public void testToUri() throws ConstructionException {
32         Node node = new Node(NodeIDType.OPENFLOW, 41L);
33         NodeConnector connector = new NodeConnector(NodeConnectorIDType.OPENFLOW, (short) 42, node);
34         Uri observed = MDFlowMapping.toUri(connector );
35
36         Assert.assertEquals("openflow:41:42", observed.getValue());
37     }
38
39 }