X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-monitoring%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fmonitoring%2FGetSchemaTest.java;h=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hb=91c463de629f598f36fb7698cc8b5941c7855892;hp=d452fd5a85c080c4bf2c7f5c475c14365c722999;hpb=50351b4cb37a1998cfaef53ff584aeb767c25f50;p=netconf.git diff --git a/netconf/netconf-monitoring/src/test/java/org/opendaylight/netconf/monitoring/GetSchemaTest.java b/netconf/netconf-monitoring/src/test/java/org/opendaylight/netconf/monitoring/GetSchemaTest.java index d452fd5a85..e69de29bb2 100644 --- a/netconf/netconf-monitoring/src/test/java/org/opendaylight/netconf/monitoring/GetSchemaTest.java +++ b/netconf/netconf-monitoring/src/test/java/org/opendaylight/netconf/monitoring/GetSchemaTest.java @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2015 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.netconf.monitoring; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.mock; - -import com.google.common.base.Optional; -import org.junit.Before; -import org.junit.Test; -import org.opendaylight.controller.config.util.xml.DocumentedException; -import org.opendaylight.controller.config.util.xml.XmlElement; -import org.opendaylight.controller.config.util.xml.XmlUtil; -import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService; -import org.w3c.dom.Document; - -public class GetSchemaTest { - - - private NetconfMonitoringService cap; - private Document doc; - private String getSchema; - - @Before - public void setUp() throws Exception { - cap = mock(NetconfMonitoringService.class); - doc = XmlUtil.newDocument(); - getSchema = "\n" - + " threadpool-api\n" - + " 2010-09-24\n" - + " ncm:yang\n" - + " \n" - + " "; - } - - @Test(expected = DocumentedException.class) - public void testDefaultGetSchema() throws Exception { - GetSchema schema = new GetSchema(cap); - doThrow(IllegalStateException.class).when(cap).getSchemaForCapability(anyString(), any(Optional.class)); - schema.handleWithNoSubsequentOperations(doc, XmlElement.fromDomElement(XmlUtil.readXmlToElement(getSchema))); - } - - @Test - public void handleWithNoSubsequentOperations() throws Exception { - GetSchema schema = new GetSchema(cap); - doReturn("").when(cap).getSchemaForCapability(anyString(), any(Optional.class)); - assertNotNull(schema.handleWithNoSubsequentOperations(doc, - XmlElement.fromDomElement(XmlUtil.readXmlToElement(getSchema)))); - } - -} \ No newline at end of file