Fix broken tests according to yangtools changes
[mdsal.git] / dom / mdsal-dom-inmemory-datastore / src / test / java / org / opendaylight / controller / md / sal / dom / store / impl / TestModel.java
1 /*
2  * Copyright (c) 2014 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 package org.opendaylight.controller.md.sal.dom.store.impl;
9
10 import java.io.File;
11 import java.util.Collections;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
14 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
15 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
16
17 public class TestModel {
18
19     public static final QName TEST_QNAME =
20             QName.create("urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test", "2014-03-13", "test");
21     public static final QName OUTER_LIST_QNAME = QName.create(TEST_QNAME, "outer-list");
22     public static final QName INNER_LIST_QNAME = QName.create(TEST_QNAME, "inner-list");
23     public static final QName OUTER_CHOICE_QNAME = QName.create(TEST_QNAME, "outer-choice");
24     public static final QName ID_QNAME = QName.create(TEST_QNAME, "id");
25     public static final QName NAME_QNAME = QName.create(TEST_QNAME, "name");
26     public static final QName VALUE_QNAME = QName.create(TEST_QNAME, "value");
27     public static final QName TWO_QNAME = QName.create(TEST_QNAME, "two");
28     public static final QName THREE_QNAME = QName.create(TEST_QNAME, "three");
29     public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier.of(TEST_QNAME);
30     public static final YangInstanceIdentifier OUTER_LIST_PATH =
31             YangInstanceIdentifier.builder(TEST_PATH).node(OUTER_LIST_QNAME).build();
32     private static final String DATASTORE_TEST_YANG = "/odl-datastore-test.yang";
33
34     public static SchemaContext createTestContext() throws Exception {
35         return YangParserTestUtils.parseYangFiles(Collections.singletonList(getFile()));
36     }
37
38     private static File getFile() throws Exception {
39         return new File(TestModel.class.getResource(DATASTORE_TEST_YANG).toURI());
40     }
41 }