Move netconf-console to apps/
[netconf.git] / netconf / sal-netconf-connector / src / test / java / org / opendaylight / netconf / sal / connect / netconf / sal / tx / TxTestUtils.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.netconf.sal.connect.netconf.sal.tx;
10
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
13 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
15 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
16
17 public final class TxTestUtils {
18
19     private static final QName Q_NAME_1 = QName.create("test:namespace", "2013-07-22", "c");
20     private static final QName Q_NAME_2 = QName.create(Q_NAME_1, "a");
21
22     private TxTestUtils() {
23
24     }
25
26     static YangInstanceIdentifier getContainerId() {
27         return YangInstanceIdentifier.builder()
28                 .node(Q_NAME_1)
29                 .build();
30     }
31
32     public static YangInstanceIdentifier getLeafId() {
33         return YangInstanceIdentifier.builder()
34                 .node(Q_NAME_1)
35                 .node(Q_NAME_2)
36                 .build();
37     }
38
39     static ContainerNode getContainerNode() {
40         return Builders.containerBuilder()
41                 .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(Q_NAME_1))
42                 .build();
43     }
44
45     public static LeafNode<String> getLeafNode() {
46         return Builders.<String>leafBuilder()
47                 .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(Q_NAME_2))
48                 .withValue("data")
49                 .build();
50     }
51 }