Merge "Formatted code for Bug-3890"
authorMaros Marsalek <mmarsale@cisco.com>
Tue, 22 Dec 2015 12:38:44 +0000 (12:38 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 22 Dec 2015 12:38:44 +0000 (12:38 +0000)
33 files changed:
opendaylight/netconf/abstract-topology/pom.xml
opendaylight/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/NetconfMdsalMonitoringMapperModule.java
opendaylight/netconf/mdsal-netconf-monitoring/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/monitoring/NetconfMdsalMonitoringMapperModuleFactory.java
opendaylight/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NetconfMdsalNotificationMapperModule.java
opendaylight/netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/NetconfMdsalNotificationMapperModuleFactory.java
opendaylight/netconf/messagebus-netconf/src/main/java/org/opendaylight/controller/config/yang/messagebus/netconf/MessageBusNetconfModule.java
opendaylight/netconf/messagebus-netconf/src/main/java/org/opendaylight/controller/config/yang/messagebus/netconf/MessageBusNetconfModuleFactory.java
opendaylight/netconf/netconf-config-dispatcher/src/test/java/org/opendaylight/controller/config/yang/config/netconf/client/dispatcher/NetconfClientDispatcherModuleTest.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfMapperAggregatorModule.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfMapperAggregatorModuleFactory.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerDispatcherModule.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerDispatcherModuleFactory.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerMonitoringModule.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/config/yang/config/netconf/northbound/impl/NetconfServerMonitoringModuleFactory.java
opendaylight/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/notification/impl/NetconfNotificationManagerModule.java
opendaylight/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/notification/impl/NetconfNotificationManagerModuleFactory.java
opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/ssh/NetconfNorthboundSshModule.java
opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/ssh/NetconfNorthboundSshModuleFactory.java
opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/tcp/NetconfNorthboundTcpModule.java
opendaylight/netconf/netconf-tcp/src/main/java/org/opendaylight/controller/config/yang/netconf/northbound/tcp/NetconfNorthboundTcpModuleFactory.java
opendaylight/netconf/netconf-topology/pom.xml
opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/controller/config/yang/clustered/netconf/topology/ClusteredNetconfTopologyModule.java
opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/controller/config/yang/clustered/netconf/topology/ClusteredNetconfTopologyModuleFactory.java
opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/controller/config/yang/netconf/topology/shared/schema/repository/SchemaRepositoryImplModule.java
opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/controller/config/yang/netconf/topology/shared/schema/repository/SchemaRepositoryImplModuleFactory.java
opendaylight/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/NetconfDeviceSimulator.java
opendaylight/restconf/sal-rest-connector/src/main/java/org/opendaylight/controller/config/yang/md/sal/rest/connector/RestConnectorModule.java
opendaylight/restconf/sal-rest-connector/src/main/java/org/opendaylight/controller/config/yang/md/sal/rest/connector/RestConnectorModuleFactory.java
opendaylight/restconf/sal-rest-connector/src/main/java/org/opendaylight/controller/config/yang/sal/restconf/service/JSONRestconfServiceModule.java
opendaylight/restconf/sal-rest-connector/src/main/java/org/opendaylight/controller/config/yang/sal/restconf/service/JSONRestconfServiceModuleFactory.java
opendaylight/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfImpl.java
opendaylight/restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestconfImplTest.java
pom.xml

index 703ee4e9bfa5fb349db5a27050151563bd2f8cc9..b600b6a98aab7e2af52ccc05c46db9330e42872f 100644 (file)
@@ -61,7 +61,6 @@
         <dependency>
             <groupId>com.typesafe</groupId>
             <artifactId>config</artifactId>
-            <version>${typesafe.config.version}</version>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
             <version>1.9.5</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>com.typesafe</groupId>
-            <artifactId>config</artifactId>
-            <version>1.2.1</version>
-        </dependency>
         <dependency>
             <groupId>com.jayway.awaitility</groupId>
             <artifactId>awaitility</artifactId>
index 985c728788438b93898f954fcd4587aa394a1919..9b779ac5571c294cec99d90a16ee80287612bb93 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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.controller.config.yang.netconf.mdsal.monitoring;
 
 import java.util.Collections;
index e0d459318fe6be4c366e9cb386f4c4eabeb19c33..026b4159ed21778398f1be23a8954c4fd9cf1dfa 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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
+ */
+
 /*
 * Generated file
 *
index df97717531303b56728695b8afd84f1d2c9d33aa..584f59de7e131583feab4f634e364a2ddcce646d 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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.controller.config.yang.netconf.mdsal.notification;
 
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
index 0f8f08f69a4324c251b82563ae4e032985d17e85..c87382cea19a4b608d61dc94a64ed69d44bec1d0 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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
+ */
+
 /*
 * Generated file
 *
index 9b90f4798af1a43362dc95d203885c5361ab0fe6..19761d495d1d2c4121d11cd8882ee21907ae1621 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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.controller.config.yang.messagebus.netconf;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
index 7681cdf02d33281ee60feaaae5363be532b3b49c..fe41f43d812e3b00320e86e0c2d749aa5a4685d6 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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
+ */
+
 /*
 * Generated file
 *
index 85477a02377af870142092de73a8c223308c703b..bd4f4e8dff98c9a47b01ff945c2b9c7488e8b14a 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (c) 2014 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.controller.config.yang.config.netconf.client.dispatcher;
 
 import javax.management.InstanceAlreadyExistsException;
index 59f20373592ba5a2e1b0cb001644ac51509466bf..4b49941ae80ee9c4ad962136f202e2ed8b5734d3 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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.controller.config.yang.config.netconf.northbound.impl;
 
 import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
index 0e415bdfcb440db004ab24f244fe922ab2605056..8a8ffb748af07b64ab93a86fac7d99d00534d41c 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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
+ */
+
 /*
 * Generated file
 *
index 5135d268312e1459ce6dac84d697a899671418d4..ce91d01334ab58e4dcfb02ba4d0f77d2b9dca554 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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.controller.config.yang.config.netconf.northbound.impl;
 
 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
index de44caddaca201849799439e608eaaba43d28a4d..61c0c7137e054afaf567fe2f9dc80c8785cdf9c9 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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
+ */
+
 /*
 * Generated file
 *
index 4bb0345c3561403656027a0ba0eaa51bfeabaae5..5a7aa06ad72148600a024fc0e211545f1f498c1e 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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.controller.config.yang.config.netconf.northbound.impl;
 
 import org.opendaylight.netconf.impl.osgi.NetconfMonitoringServiceImpl;
index fe74486a7717dcdbf959e105b4c36674341b71ef..8b4cb65ed2731cf5e6b9ad7d2d526f7c53bf8ad4 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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
+ */
+
 /*
 * Generated file
 *
index b50ff024c6c970cb54237142a6ddeb1b580ac51b..d9dce4b99d95327b0ef5a4326fa7a38573d817e2 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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.controller.config.yang.netconf.northbound.notification.impl;
 
 import org.opendaylight.netconf.notifications.impl.NetconfNotificationManager;
index 624c262d20640e9d0d934cc5f82ae796ca643f5d..dadf7562006e935300970cffef73e4586b93c0c8 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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
+ */
+
 /*
 * Generated file
 *
index f212edc2d3f3a4f44aae85d53c1fa06d993d2afa..be457f961d78f9ba07fd5023ec0aed3bc80fc9c0 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (c) 2014 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.controller.config.yang.netconf.northbound.ssh;
 
 import io.netty.channel.ChannelFuture;
index 4e107ec24d6c291c315d6adca8747101405aac4c..88ad64bcf74a10f6a6181a18f5aa2de7abb79919 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (c) 2014 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
+ */
+
 /*
 * Generated file
 *
index b9156f6c82538ac0546fa123ff665439ec90a240..bb33aaa23340f4afd438f403153f402bc31284df 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (c) 2014 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.controller.config.yang.netconf.northbound.tcp;
 
 import io.netty.channel.ChannelFuture;
index 081486ecf4cafb8c7647580d0f639b4568ff1ba7..3ed70d9ce5ce86b70f929a72517761e491957934 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (c) 2014 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
+ */
+
 /*
 * Generated file
 *
index 94b0d40e19325ee7a07c22ee54c91e9da211310c..fb9c4257f5010dc0f3e4963a5333948a686f87e3 100644 (file)
@@ -89,7 +89,6 @@
         <dependency>
             <groupId>com.typesafe</groupId>
             <artifactId>config</artifactId>
-            <version>${typesafe.config.version}</version>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
index 61e15700c015a39dd94926087d64825bcfa8c2f4..54be237e369d9da9d51e704d2eda7f138934893d 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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.controller.config.yang.clustered.netconf.topology;
 
 import org.opendaylight.netconf.topology.impl.ClusteredNetconfTopology;
index 6017de309733e24fd1a21f6b0c308554ad67daf3..0fb3a5bcc44b5aab83a68cc874d8c29572e13673 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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
+ */
+
 /*
 * Generated file
 *
index 5ea2f50fc93ff5b5102ae194a8fc2af2522e0a1b..c4f5f98820609cb8aad41522edeee925ef1a00a2 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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.controller.config.yang.netconf.topology.shared.schema.repository;
 
 import org.opendaylight.netconf.topology.SchemaRepositoryProvider;
index b3a64d496e4c62ff65bc4df6f60daf7ff5518dd8..9cf6e1cc6a02bd46ecdef6e8ec9c6d8fd63ddc24 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * 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
+ */
+
 /*
 * Generated file
 *
index 212385f2943f62799143242a2c0103faddd7dff8..97739e1614dd0cb8d27db203dc9e7b5f7fb07803 100644 (file)
@@ -298,21 +298,28 @@ public class NetconfDeviceSimulator implements Closeable {
         final Set<Capability> capabilities = Sets.newHashSet();
 
         for (final Module module : schemaContext.getModules()) {
-            final SourceIdentifier moduleSourceIdentifier = new SourceIdentifier(module.getName(),
-                    SimpleDateFormatUtil.getRevisionFormat().format(module.getRevision()));
-            try {
-                String moduleContent = new String(consumer.getSchemaSource(moduleSourceIdentifier, YangTextSchemaSource.class)
-                        .checkedGet().read());
-                capabilities.add(new YangModuleCapability(module, moduleContent));
-                //IOException would be thrown in creating SchemaContext already
-            } catch (SchemaSourceException|IOException e) {
-                throw new RuntimeException("Cannot retrieve schema source for module " + moduleSourceIdentifier.toString() + " from schema repository", e);
+            for (final Module subModule : module.getSubmodules()) {
+                addModuleCapability(consumer, capabilities, subModule);
             }
+            addModuleCapability(consumer, capabilities, module);
         }
-
         return capabilities;
     }
 
+    private void addModuleCapability(SharedSchemaRepository consumer, Set<Capability> capabilities, Module module) {
+        final SourceIdentifier moduleSourceIdentifier = SourceIdentifier.create(module.getName(),
+                (SimpleDateFormatUtil.DEFAULT_DATE_REV == module.getRevision() ? Optional.<String>absent() :
+                        Optional.of(SimpleDateFormatUtil.getRevisionFormat().format(module.getRevision()))));
+        try {
+            String moduleContent = new String(consumer.getSchemaSource(moduleSourceIdentifier, YangTextSchemaSource.class)
+                    .checkedGet().read());
+            capabilities.add(new YangModuleCapability(module, moduleContent));
+            //IOException would be thrown in creating SchemaContext already
+        } catch (SchemaSourceException |IOException e) {
+            throw new RuntimeException("Cannot retrieve schema source for module " + moduleSourceIdentifier.toString() + " from schema repository", e);
+        }
+    }
+
     private void addDefaultSchemas(final SharedSchemaRepository consumer) {
         SourceIdentifier sId = new SourceIdentifier("ietf-netconf-monitoring", "2010-10-04");
         registerSource(consumer, "/META-INF/yang/ietf-netconf-monitoring.yang", sId);
index a7d6c8816b8cd46a0721c5eca9ce3c067a46079f..6b2aedcce459f7796831b175e06675eb46bb8157 100644 (file)
@@ -1,3 +1,11 @@
+/**
+ * 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.controller.config.yang.md.sal.rest.connector;
 
 import org.opendaylight.netconf.sal.restconf.impl.RestconfProviderImpl;
index 1964a174729f2133159f0cacb5fdbb90fd7fc387..fb664628903d017b149831949ba804b555e2c6f1 100644 (file)
@@ -1,3 +1,10 @@
+/**
+ * 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
+ */
 /*
 * Generated file
 *
index 8da5dcb6cbb4ce54dae9713f2f4d335fc1e95444..5aa0e8ebd52ea175f5171f0c1f96b58c5721612f 100644 (file)
@@ -1,3 +1,11 @@
+/**
+ * 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.controller.config.yang.sal.restconf.service;
 
 import org.opendaylight.netconf.sal.restconf.impl.JSONRestconfServiceImpl;
index d822afd76e689b4173e11167e14a800b2cd77d43..68e3856529091c100f81427f15fd92cb56e3d6f6 100644 (file)
@@ -1,3 +1,10 @@
+/**
+ * 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
+ */
 /*
 * Generated file
 *
index 6d19dfc9235afc184fd82a2dad767f8cc96bdc9f..18b02cfa3449f32954f54320852aa500bf20947d 100644 (file)
@@ -108,8 +108,6 @@ public class RestconfImpl implements RestconfService {
 
     private static final int CHAR_NOT_FOUND = -1;
 
-    private static final String MOUNT_POINT_MODULE_NAME = "ietf-netconf";
-
     private static final SimpleDateFormat REVISION_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
 
     private static final String SAL_REMOTE_NAMESPACE = "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote";
@@ -434,7 +432,7 @@ public class RestconfImpl implements RestconfService {
         final CheckedFuture<DOMRpcResult, DOMRpcException> response;
         final DOMMountPoint mountPoint = payload.getInstanceIdentifierContext().getMountPoint();
         final SchemaContext schemaContext;
-        if (identifier.contains(MOUNT_POINT_MODULE_NAME) && mountPoint != null) {
+        if (mountPoint != null) {
             final Optional<DOMRpcService> mountRpcServices = mountPoint.getService(DOMRpcService.class);
             if ( ! mountRpcServices.isPresent()) {
                 LOG.debug("Error: Rpc service is missing.");
index ca5fbfeb357778d952d80fc72f8c63d31dc12951..72b5b3d9f7e131cd2d59e506175317db174b14b6 100644 (file)
@@ -10,23 +10,39 @@ package org.opendaylight.controller.sal.restconf.impl.test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.Futures;
 import java.io.FileNotFoundException;
 import java.text.ParseException;
 import java.util.Set;
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.UriInfo;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
+import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
+import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
 import org.opendaylight.netconf.sal.restconf.impl.BrokerFacade;
 import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
+import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
+import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfImpl;
+import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
 /**
  * @See {@link InvokeRpcMethodTest}
@@ -65,4 +81,26 @@ public class RestconfImplTest {
                 brokerFacade.readOperationalData(null));
     }
 
+    @Test
+    public void testRpcForMountpoint() throws Exception {
+        final UriInfo uriInfo = mock(UriInfo.class);
+        doReturn(new MultivaluedHashMap<>()).when(uriInfo).getQueryParameters(anyBoolean());
+
+        final NormalizedNodeContext ctx = mock(NormalizedNodeContext.class);
+        final InstanceIdentifierContext iiCtx = mock(InstanceIdentifierContext.class);
+        doReturn(iiCtx).when(ctx).getInstanceIdentifierContext();
+        final SchemaNode schemaNode = mock(SchemaNode.class);
+        doReturn(schemaNode).when(iiCtx).getSchemaNode();
+        doReturn(mock(SchemaPath.class)).when(schemaNode).getPath();
+        doReturn(QName.create("namespace", "2010-10-10", "localname")).when(schemaNode).getQName();
+
+        final DOMMountPoint mount = mock(DOMMountPoint.class);
+        doReturn(mount).when(iiCtx).getMountPoint();
+        final DOMRpcService rpcService = mock(DOMRpcService.class);
+        doReturn(Optional.of(rpcService)).when(mount).getService(DOMRpcService.class);
+        doReturn(Futures.immediateCheckedFuture(mock(DOMRpcResult.class))).when(rpcService).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
+        restconfImpl.invokeRpc("randomId", ctx, uriInfo);
+        restconfImpl.invokeRpc("ietf-netconf", ctx, uriInfo);
+        verify(rpcService, times(2)).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
+    }
 }
diff --git a/pom.xml b/pom.xml
index 55532876972bee49c50efbb84d22b2113d142f00..3ee16d98b480fe96ec663798b679f7eccc38e41b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -47,7 +47,6 @@
         <scala.major.version>2.10</scala.major.version>
         <scala.minor.version>4</scala.minor.version>
         <surefire.version>2.15</surefire.version>
-        <typesafe.config.version>1.2.1</typesafe.config.version>
         <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
 
         <jmxGeneratorPath>src/main/yang-gen-config</jmxGeneratorPath>