Merge "Bug 2358: Fixed warnings in Restconf"
[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
20 public class CnSnToJsonNotExistingLeafTypeTest extends YangAndXmlAndDataSchemaLoader {
21
22     @BeforeClass
23     public static void initialize() {
24         dataLoad("/cnsn-to-json/simple-data-types");
25     }
26
27     @SuppressWarnings("unused")
28     private DataSchemaNode prepareDataSchemaNode() {
29         final ContainerSchemaNodeBuilder contBuild = new ContainerSchemaNodeBuilder("module", 1, TestUtils.buildQName("cont",
30                 "simple:uri", "2012-12-17"), SchemaPath.create(true, QName.create("dummy")));
31         final LeafSchemaNodeBuilder leafBuild = new LeafSchemaNodeBuilder("module", 2, TestUtils.buildQName("lf1",
32                 "simple:uri", "2012-12-17"), SchemaPath.create(true, QName.create("dummy")));
33         leafBuild.setType(new DummyType());
34         leafBuild.setConfiguration(true);
35
36         contBuild.addChildNode(leafBuild);
37         return contBuild.build();
38     }
39
40 }