2 * Copyright (c) 2016 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.netconf.topology.singleton.impl.utils;
10 import static org.junit.Assert.assertEquals;
12 import org.junit.Test;
13 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
14 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
15 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
16 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
17 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
19 public class NetconfTopologyUtilTest {
21 public void testCreateActorPath() {
22 final String actorPath = NetconfTopologyUtils.createActorPath("member", "name");
23 assertEquals("member/user/name", actorPath);
27 public void testCreateListPath() {
28 final InstanceIdentifier<Node> listPath =
29 NetconfTopologyUtils.createTopologyNodeListPath(new NodeKey(new NodeId("nodeId")), "topologyId");
31 assertEquals("nodeId", listPath.firstKeyOf(Node.class).getNodeId().getValue());
32 assertEquals("topologyId", listPath.firstKeyOf(Topology.class).getTopologyId().getValue());
34 assertEquals("topologyId", NetconfTopologyUtils.createTopologyNodePath("topologyId")
35 .firstKeyOf(Topology.class).getTopologyId().getValue());