Merge "Add NodeConfiguratorImpl enqueue trace"
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / util / PathUtilTest.java
1 /*
2  * Copyright (c) 2016 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
9 package org.opendaylight.openflowplugin.impl.util;
10
11 import org.junit.Assert;
12 import org.junit.Test;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
18 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
19
20 /**
21  * Test for {@link PathUtil}.
22  */
23 public class PathUtilTest {
24
25     private static final NodeId NODE_ID = new NodeId("ut-dummy-node");
26     private static final NodeKey NODE_KEY = new NodeKey(NODE_ID);
27     private static final InstanceIdentifier<Node> NODE_II
28             = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY);
29     private static final NodeRef NODE_REF = new NodeRef(NODE_II);
30
31     @Test
32     public void testExtractNodeId() {
33         Assert.assertEquals(NODE_ID, PathUtil.extractNodeId(NODE_REF));
34     }
35
36     @Test
37     public void testExtractNodeId2() {
38         Assert.assertEquals(NODE_ID, PathUtil.extractNodeId(NODE_II));
39     }
40 }