2 * Copyright (c) 2014 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.controller.md.cluster.datastore.model;
10 import java.io.InputStream;
11 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
12 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
14 public final class SchemaContextHelper {
16 public static final String ODL_DATASTORE_TEST_YANG = "/odl-datastore-test.yang";
17 public static final String PEOPLE_YANG = "/people.yang";
18 public static final String CARS_YANG = "/cars.yang";
20 private SchemaContextHelper() {
24 public static InputStream getInputStream(final String yangFileName) {
25 return SchemaContextHelper.class.getResourceAsStream(yangFileName);
28 public static SchemaContext full() {
29 return select(ODL_DATASTORE_TEST_YANG, PEOPLE_YANG, CARS_YANG);
32 public static SchemaContext select(final String... schemaFiles) {
33 return YangParserTestUtils.parseYangResources(SchemaContextHelper.class, schemaFiles);
36 public static SchemaContext distributedShardedDOMDataTreeSchemaContext() {
37 // we need prefix-shard-configuration and odl-datastore-test models
38 // for DistributedShardedDOMDataTree tests
39 return YangParserTestUtils.parseYangResources(SchemaContextHelper.class, ODL_DATASTORE_TEST_YANG,
40 "/META-INF/yang/prefix-shard-configuration@2017-01-10.yang");