blob: 17b41dd1ad175b4dd17a1c75ff150c4fb9c99218 [file] [log] [blame]
VinodKumarS-Huawei7b1733c2016-10-25 13:44:26 +05301/*
2 * Copyright 2016-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.yms.app.yob;
17
18import org.onosproject.yms.app.ysr.TestYangSchemaNodeProvider;
19import org.onosproject.yms.app.ysr.YangSchemaRegistry;
20
21/**
22 * YOB test Utility.
23 */
24final class YobTestUtils {
25
26 /**
27 * Schema nodes.
28 */
29 static final String ROOT_DATA_RESOURCE = "/restconf/data";
30 static final String TOPOLOGY = "yms-topology";
31 static final String NODE = "node";
32 static final String LEAF_1A1 = "leaf1a1";
33 static final String LEAF_1A2 = "leaf1a2";
34 static final String LEAF_1BIA = "leaf1bia";
35 static final String LEAF_1BIB = "leaf1bib";
36 static final String ROUTER_ID = "router-id";
37 static final String ROUTER_IP = "router-ip";
38 static final String STR_LEAF_VALUE = "leaf value";
39
40 private YobTestUtils() {
41 TEST_SCHEMA_PROVIDER.processSchemaRegistry(null);
42 }
43
44 private static final TestYangSchemaNodeProvider
45 TEST_SCHEMA_PROVIDER = new TestYangSchemaNodeProvider();
46
47 YangSchemaRegistry schemaRegistry() {
48 return TEST_SCHEMA_PROVIDER.getDefaultYangSchemaRegistry();
49 }
50
51 /**
52 * Returns the YANG object builder factory instance.
53 *
54 * @return YANG object builder factory instance
55 */
56 static YobTestUtils instance() {
57 return LazyHolder.INSTANCE;
58 }
59
60 /*
61 * Bill Pugh Singleton pattern. INSTANCE won't be instantiated until the
62 * LazyHolder class is loaded via a call to the instance() method below.
63 */
64 private static class LazyHolder {
65 private static final YobTestUtils INSTANCE = new YobTestUtils();
66 }
67}