2 * Copyright (c) 2015 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.yangtools.yang.data.impl.schema.tree;
10 import java.io.InputStream;
11 import java.util.Arrays;
12 import java.util.Collections;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 import org.opendaylight.yangtools.yang.data.impl.RetestUtils;
17 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
20 public class RetestModel {
22 public static final QName TEST_QNAME = QName.create(
23 "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test", "2014-03-13", "test");
24 public static final QName OUTER_LIST_QNAME = QName.create(TEST_QNAME, "outer-list");
25 public static final QName INNER_LIST_QNAME = QName.create(TEST_QNAME, "inner-list");
26 public static final QName OUTER_CHOICE_QNAME = QName.create(TEST_QNAME, "outer-choice");
27 public static final QName ID_QNAME = QName.create(TEST_QNAME, "id");
28 public static final QName NAME_QNAME = QName.create(TEST_QNAME, "name");
29 public static final QName VALUE_QNAME = QName.create(TEST_QNAME, "value");
30 private static final String DATASTORE_TEST_YANG = "/odl-datastore-test.yang";
32 public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier.of(TEST_QNAME);
33 public static final YangInstanceIdentifier OUTER_LIST_PATH = YangInstanceIdentifier.builder(TEST_PATH)
34 .node(OUTER_LIST_QNAME).build();
35 public static final QName TWO_QNAME = QName.create(TEST_QNAME, "two");
36 public static final QName THREE_QNAME = QName.create(TEST_QNAME, "three");
38 public static InputStream getDatastoreTestInputStream() {
39 return RetestModel.class.getResourceAsStream(DATASTORE_TEST_YANG);
42 public static SchemaContext createTestContext() throws ReactorException {
43 return RetestUtils.parseYangStreams(Arrays.asList(getDatastoreTestInputStream()));
46 public static SchemaContext createTestContext(String resourcePath) throws ReactorException {
47 InputStream yangStream = RetestModel.class.getResourceAsStream(resourcePath);
48 return RetestUtils.parseYangStreams(Collections.singletonList(yangStream));