Merge "Fix modules Restconf call for mounted devices"
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / cnsn / to / json / test / CnSnToJsonNotExistingLeafTypeTest.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.sal.restconf.impl.cnsn.to.json.test;
9
10 import org.junit.BeforeClass;
11 import org.opendaylight.controller.sal.restconf.impl.test.DummyType;
12 import org.opendaylight.controller.sal.restconf.impl.test.TestUtils;
13 import org.opendaylight.controller.sal.restconf.impl.test.YangAndXmlAndDataSchemaLoader;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
16 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
17 import org.opendaylight.yangtools.yang.parser.builder.impl.ContainerSchemaNodeBuilder;
18 import org.opendaylight.yangtools.yang.parser.builder.impl.LeafSchemaNodeBuilder;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
21
22 public class CnSnToJsonNotExistingLeafTypeTest extends YangAndXmlAndDataSchemaLoader {
23
24     private static final Logger LOG = LoggerFactory.getLogger(CnSnToJsonNotExistingLeafTypeTest.class);
25
26     @BeforeClass
27     public static void initialize() {
28         dataLoad("/cnsn-to-json/simple-data-types");
29     }
30
31     private DataSchemaNode prepareDataSchemaNode() {
32         final ContainerSchemaNodeBuilder contBuild = new ContainerSchemaNodeBuilder("module", 1, TestUtils.buildQName("cont",
33                 "simple:uri", "2012-12-17"), SchemaPath.create(true, QName.create("dummy")));
34         final LeafSchemaNodeBuilder leafBuild = new LeafSchemaNodeBuilder("module", 2, TestUtils.buildQName("lf1",
35                 "simple:uri", "2012-12-17"), SchemaPath.create(true, QName.create("dummy")));
36         leafBuild.setType(new DummyType());
37         leafBuild.setConfiguration(true);
38
39         contBuild.addChildNode(leafBuild);
40         return contBuild.build();
41     }
42
43 }