X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-parser-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fstmt%2Fyin%2FYinFileRpcStmtTest.java;fp=yang%2Fyang-parser-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fstmt%2Fyin%2FYinFileRpcStmtTest.java;h=0000000000000000000000000000000000000000;hb=1cc6359e5bae1459582e9262a24ca56f23bcc70f;hp=97248a8dc371553c9b4fa7a32da7e95e3ae40ed1;hpb=3b445156dfea75955b98f40208ffea51fe252209;p=yangtools.git diff --git a/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileRpcStmtTest.java b/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileRpcStmtTest.java deleted file mode 100644 index 97248a8dc3..0000000000 --- a/yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/yin/YinFileRpcStmtTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.yangtools.yang.stmt.yin; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.Optional; -import java.util.Set; -import org.junit.Before; -import org.junit.Test; -import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode; -import org.opendaylight.yangtools.yang.model.api.Module; -import org.opendaylight.yangtools.yang.model.api.RpcDefinition; -import org.opendaylight.yangtools.yang.model.api.SchemaContext; -import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException; -import org.opendaylight.yangtools.yang.stmt.TestUtils; -import org.xml.sax.SAXException; - -public class YinFileRpcStmtTest { - - private SchemaContext context; - - @Before - public void init() throws URISyntaxException, ReactorException, SAXException, IOException { - context = TestUtils.loadYinModules(getClass().getResource("/semantic-statement-parser/yin/modules").toURI()); - assertEquals(9, context.getModules().size()); - } - - @Test - public void testRpc() { - Module testModule = TestUtils.findModule(context, "ietf-netconf-monitoring").get(); - - Set rpcs = testModule.getRpcs(); - assertEquals(1, rpcs.size()); - - RpcDefinition rpc = rpcs.iterator().next(); - assertEquals("get-schema", rpc.getQName().getLocalName()); - assertEquals(Optional.of("This operation is used to retrieve a schema from the\n" - + "NETCONF server.\n" - + "\n" - + "Positive Response:\n" - + "The NETCONF server returns the requested schema.\n" - + "\n" - + "Negative Response:\n" - + "If requested schema does not exist, the is\n" - + "'invalid-value'.\n" - + "\n" - + "If more than one schema matches the requested parameters, the\n" - + " is 'operation-failed', and is\n" - + "'data-not-unique'."), rpc.getDescription()); - - ContainerSchemaNode input = rpc.getInput(); - assertNotNull(input); - assertEquals(3, input.getChildNodes().size()); - - ContainerSchemaNode output = rpc.getOutput(); - assertNotNull(output); - assertEquals(1, output.getChildNodes().size()); - } -}