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.sal.restconf.impl.cnsn.to.json.test;
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;
20 public class CnSnToJsonNotExistingLeafTypeTest extends YangAndXmlAndDataSchemaLoader {
23 public static void initialize() {
24 dataLoad("/cnsn-to-json/simple-data-types");
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);
36 contBuild.addChildNode(leafBuild);
37 return contBuild.build();