Vidyashree Rama | 6160be1 | 2016-11-24 13:43:31 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame^] | 2 | * Copyright 2016-present Open Networking Foundation |
Vidyashree Rama | 6160be1 | 2016-11-24 13:43:31 +0530 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.yms.app.yob; |
| 17 | |
| 18 | import org.onosproject.yms.app.ysr.TestYangSchemaNodeProvider; |
| 19 | import org.onosproject.yms.app.ysr.YangSchemaRegistry; |
| 20 | |
| 21 | /** |
| 22 | * YOB test Utility. |
| 23 | */ |
| 24 | final 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 | static final String YMS_IETF_NETWORK = "yms-ietf-network"; |
| 40 | static final String NETWORKS_STATE = "networks-state"; |
| 41 | static final String NETWORKS = "networks"; |
| 42 | static final String NETWORK = "network"; |
| 43 | static final String NETWORK_REF = "network-ref"; |
| 44 | static final String IETF_TE_TOPOLOGY = "yms-ietf-te-topology"; |
| 45 | static final String TE_NODE_EVENT = "te-node-event"; |
| 46 | static final String TE_NODE_ATTRIBUTES = "te-node-attributes"; |
| 47 | static final String ADMIN_STATUS = "admin-status"; |
| 48 | static final String UP = "up"; |
| 49 | static final String LINK = "link"; |
| 50 | static final String YMS_NETWORK_TOPOLOGY = "yms-network-topology"; |
| 51 | static final String TE = "te"; |
| 52 | static final String CONFIG = "config"; |
| 53 | static final String BUNDLED_LINKS = "bundled-links"; |
| 54 | static final String BUNDLED_LINK = "bundled-link"; |
| 55 | static final String SEQUENCE = "sequence"; |
| 56 | static final String TE_LINK_TEMPLATE = "te-link-template"; |
| 57 | |
| 58 | private YobTestUtils() { |
| 59 | TEST_SCHEMA_PROVIDER.processSchemaRegistry(null); |
| 60 | } |
| 61 | |
| 62 | private static final TestYangSchemaNodeProvider |
| 63 | TEST_SCHEMA_PROVIDER = new TestYangSchemaNodeProvider(); |
| 64 | |
| 65 | YangSchemaRegistry schemaRegistry() { |
| 66 | return TEST_SCHEMA_PROVIDER.getDefaultYangSchemaRegistry(); |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Returns the YANG object builder factory instance. |
| 71 | * |
| 72 | * @return YANG object builder factory instance |
| 73 | */ |
| 74 | static YobTestUtils instance() { |
| 75 | return LazyHolder.INSTANCE; |
| 76 | } |
| 77 | |
| 78 | /* |
| 79 | * Bill Pugh Singleton pattern. INSTANCE won't be instantiated until the |
| 80 | * LazyHolder class is loaded via a call to the instance() method below. |
| 81 | */ |
| 82 | private static class LazyHolder { |
| 83 | private static final YobTestUtils INSTANCE = new YobTestUtils(); |
| 84 | } |
| 85 | } |