Integrate MRI projects for Neon 66/74966/53
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 9 Aug 2018 10:07:50 +0000 (12:07 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 24 Oct 2018 16:36:40 +0000 (16:36 +0000)
This patch bumps:
- odlparent to 4.0.2
- yangtools to 2.1.2
- mdsal to 3.0.1

It deals with the fallout in following ways:
- xmlunit -> xmlunit-legacy
- fix unstubbed methods
- migrate to java.util.Optional where needed
- update test data to account for automatic list removal
- update to sshd-2.0.0
- account for ietf-{inet,yang}-types moving
- remove explicit null in blueprint
- use isNull() instead of any(Class<T>) where we want to match null
- prevent UnnecessaryStubbingException in TestRestconfUtils class
- remove jersey-related version overrides
- reuse NoOpListenerRegistration

JIRA: NETCONF-555
JIRA: NETCONF-564
Change-Id: Ib2b6bc8cfe868f1c268b243052429e6a10cfb5e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
133 files changed:
features/netconf-connector/features-netconf-connector/pom.xml
features/netconf-connector/odl-message-bus/pom.xml
features/netconf-connector/odl-netconf-callhome-ssh/pom.xml
features/netconf-connector/odl-netconf-clustered-topology/pom.xml
features/netconf-connector/odl-netconf-connector-all/pom.xml
features/netconf-connector/odl-netconf-connector-ssh/pom.xml
features/netconf-connector/odl-netconf-connector/pom.xml
features/netconf-connector/odl-netconf-console/pom.xml
features/netconf-connector/odl-netconf-topology/pom.xml
features/netconf-connector/pom.xml
features/netconf/features-netconf/pom.xml
features/netconf/odl-aaa-netconf-plugin-no-cluster/pom.xml
features/netconf/odl-aaa-netconf-plugin/pom.xml
features/netconf/odl-netconf-all/pom.xml
features/netconf/odl-netconf-api/pom.xml
features/netconf/odl-netconf-api/src/main/feature/feature.xml
features/netconf/odl-netconf-client/pom.xml
features/netconf/odl-netconf-impl/pom.xml
features/netconf/odl-netconf-mapping-api/pom.xml
features/netconf/odl-netconf-mdsal/pom.xml
features/netconf/odl-netconf-monitoring/pom.xml
features/netconf/odl-netconf-netty-util/pom.xml
features/netconf/odl-netconf-netty-util/src/main/feature/feature.xml
features/netconf/odl-netconf-notifications-api/pom.xml
features/netconf/odl-netconf-notifications-impl/pom.xml
features/netconf/odl-netconf-ssh/pom.xml
features/netconf/odl-netconf-tcp/pom.xml
features/netconf/odl-netconf-util/pom.xml
features/netconf/odl-netconf-util/src/main/feature/feature.xml
features/netconf/pom.xml
features/pom.xml
features/protocol-framework/features-protocol-framework/pom.xml
features/protocol-framework/odl-protocol-framework/pom.xml
features/protocol-framework/pom.xml
features/restconf/features-restconf/pom.xml
features/restconf/odl-mdsal-apidocs/pom.xml
features/restconf/odl-mdsal-apidocs/src/main/feature/feature.xml
features/restconf/odl-restconf-all/pom.xml
features/restconf/odl-restconf-base/pom.xml
features/restconf/odl-restconf-common/pom.xml
features/restconf/odl-restconf-common/src/main/feature/feature.xml
features/restconf/odl-restconf-nb-rfc8040-all/pom.xml
features/restconf/odl-restconf-nb-rfc8040/pom.xml
features/restconf/odl-restconf-noauth/pom.xml
features/restconf/odl-restconf/pom.xml
features/restconf/odl-restconf/src/main/feature/feature.xml
features/restconf/pom.xml
features/yanglib/features-yanglib/pom.xml
features/yanglib/odl-yanglib/pom.xml
features/yanglib/odl-yanglib/src/main/feature/feature.xml
features/yanglib/pom.xml
karaf/pom.xml
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServerBuilder.java
netconf/callhome-protocol/src/test/java/org/opendaylight/netconf/callhome/protocol/MinaSshNettyChannelTest.java
netconf/callhome-protocol/src/test/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServerTest.java
netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java
netconf/mdsal-netconf-connector/pom.xml
netconf/mdsal-netconf-connector/src/test/resources/messages/mapping/editConfigs/editConfig_merge_multiple_operations_4_delete_children_operations_control.xml
netconf/mdsal-netconf-impl/src/main/resources/org/opendaylight/blueprint/mdsal-netconf-impl.xml
netconf/mdsal-netconf-monitoring/pom.xml
netconf/mdsal-netconf-yang-library/pom.xml
netconf/messagebus-netconf/src/main/java/org/opendaylight/netconf/messagebus/eventsources/netconf/NetconfEventSourceMount.java
netconf/models/ietf-netconf-monitoring/pom.xml
netconf/models/ietf-netconf-notifications/pom.xml
netconf/models/ietf-netconf/pom.xml
netconf/models/pom.xml
netconf/netconf-api/pom.xml
netconf/netconf-artifacts/pom.xml
netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/NetconfClientDispatcherImplTest.java
netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiatorTest.java
netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/SimpleNetconfClientSessionListenerTest.java
netconf/netconf-config/pom.xml
netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/commands/NetconfCommandsImplCallsTest.java
netconf/netconf-impl/pom.xml
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSessionNegotiatorFactory.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/NetconfServerSessionListenerTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/mapping/operations/DefaultCloseSessionTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/osgi/NetconfImplActivatorTest.java
netconf/netconf-monitoring/pom.xml
netconf/netconf-monitoring/src/test/java/org/opendaylight/netconf/monitoring/osgi/NetconfMonitoringActivatorTest.java
netconf/netconf-netty-util/pom.xml
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerWriter.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionTest.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerTest.java
netconf/netconf-notifications-impl/pom.xml
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/NotificationsTransformUtil.java
netconf/netconf-parent/pom.xml
netconf/netconf-ssh/pom.xml
netconf/netconf-ssh/src/main/java/org/opendaylight/netconf/ssh/RemoteNetconfCommand.java
netconf/netconf-topology-config/pom.xml
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/ProxyDOMRpcService.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/rpc/InvokeRpcMessageReply.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeActorTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManagerTest.java
netconf/netconf-util/pom.xml
netconf/pom.xml
netconf/sal-netconf-connector/pom.xml
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceRpc.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDeviceTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/SchemalessNetconfDeviceTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/KeepaliveSalFacadeTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceSalFacadeTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceTopologyAdapterTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/NetconfDeviceWriteOnlyTxTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfBaseOpsTest.java
netconf/tools/netconf-testtool/pom.xml
netconf/tools/pom.xml
netconf/yanglib/pom.xml
pom.xml
protocol-framework/pom.xml
restconf/pom.xml
restconf/restconf-artifacts/pom.xml
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfDocumentedException.java
restconf/restconf-models/ietf-restconf-monitoring/pom.xml
restconf/restconf-models/ietf-restconf/pom.xml
restconf/restconf-models/pom.xml
restconf/restconf-nb-bierman02/pom.xml
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/md/sal/rest/common/TestRestconfUtils.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/InvokeRpcMethodTest.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/JSONRestconfServiceImplTest.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPostOperationTest.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestconfImplTest.java
restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-del.json
restconf/restconf-nb-rfc8040/pom.xml
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040ImplTest.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/RestconfInvokeOperationsUtilTest.java
restconf/restconf-nb-rfc8040/src/test/resources/listener-adapter-test/notif-del.json
restconf/restconf-parent/pom.xml
restconf/sal-rest-connector-config/pom.xml
restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/jaxrs/JaxbContextResolver.java

index a4464bf8bdff5af24cb37a9c2384296c8b80daff..e442f15beaadb8695bd9c88ac19b773c762b916b 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>feature-repo-parent</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
index ff63191ad0cf7e7097ca618486851400d1ba56bd..dea108a0c12a94de610c7438f9b7677f3f6b576f 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 7cc273da7554db9e76ec8796550cc8089d00213a..6491056f9afcb99463e7a868deea0654815b5b63 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index af4a790d38e577bd5029fa56a0f40b7ecd7f2d25..d87bf9028768b9de53976e7cfd2d4204d73d298f 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index f6843705ae666f5e979114c935faf1b261e19801..666a0172e0b784bdef461ccbde90d48bbfa04ebf 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 576334b3462ab1eecce6c499fb07e240d4576580..5ac4d7a93d77ec30d4f6f16dcd78e5937282f856 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 717770d2734a6827d115f8ee68b25029d61d111a..862044006642344ac4f8150599060af4eff4aab5 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
@@ -28,7 +28,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>2.6.0-SNAPSHOT</version>
+                <version>3.0.1</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 609b2b80d94fb8a96dbc578d14689a6f4abfa2d2..dae6b1928176a7fd269f92668d7d7175b27b43ed 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index a548ee61977f6355122025e95974076ef9919ebc..30479899d98618cc5a2b27de06b9a7b29c7c8cb5 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 7756683f1d2f48a97955cc65da6daf40284ddbc8..f2b82d4858be27ebe8a39a9445c39a221d1a361c 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
     <groupId>org.opendaylight.netconf</groupId>
@@ -22,9 +22,7 @@
     <properties>
       <commons.opendaylight.version>1.12.0-SNAPSHOT</commons.opendaylight.version>
       <controller.mdsal.version>1.9.0-SNAPSHOT</controller.mdsal.version>
-      <config.version>0.10.0-SNAPSHOT</config.version>
-      <mdsal.version>2.6.0-SNAPSHOT</mdsal.version>
-      <mdsal.model.version>0.14.0-SNAPSHOT</mdsal.model.version>
+      <mdsal.version>3.0.1</mdsal.version>
       <netconf.version>1.6.0-SNAPSHOT</netconf.version>
       <netconf.connector.version>1.9.0-SNAPSHOT</netconf.connector.version>
     </properties>
@@ -53,7 +51,7 @@
       <dependency>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-artifacts</artifactId>
-        <version>2.0.10</version>
+        <version>2.1.2</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>features-mdsal-model</artifactId>
-      <version>${mdsal.model.version}</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-      <scope>runtime</scope>
-    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>features-netconf</artifactId>
index 643f425e7e69526214ef1d162a455219de843e18..61cc976c5268d7698fec2608b8107d01ad9c16a1 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>feature-repo-parent</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
index b31ab9ff399aedba3fefdf80d65dce565ff96fe6..4978bc34db9d208b5df79ac4ad3453fd47086f75 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 097edaab33fd5904f79c324f32b94cd68aeb229a..7046440045261eb6746e3b546b51ebadea23f1ab 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index be2e6c3f1b7203c4213a4666e341d5c45b668c82..814673952cc678479664e12c101d80ec4e690c97 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 41ab9f5ab2b11fd510cc8415bdb5a075b46587e9..10aa6976ef88184fd287e11d799f2fa7c2e2c7b9 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>2.0.10</version>
+                <version>2.1.2</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>2.6.0-SNAPSHOT</version>
+                <version>3.0.1</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 689267ef2fdb03a128f9e911ebabcf5f876e6e79..b23837d4d4f758b44eefe76d1b89185205bcb5b5 100644 (file)
@@ -8,6 +8,6 @@
   -->
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-netconf-${project.version}">
     <feature name="odl-netconf-api" version="${project.version}">
-        <feature version="[2.0.10,3)">odl-yangtools-parser-api</feature>
+        <feature version="[2.1,3)">odl-yangtools-parser-api</feature>
     </feature>
 </features>
index d86d60ee74b501b89ff628ad8070bcab8493dcc1..16f9e937726044bf24987062338d3e3a73f46cc3 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 272c7fbdd9f01f1d043da0ac1c46fb0d78d41137..88fba1138d41ddcb65ad5a5c60498a36c1db2a3e 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 2edb50945c0f7cf7e85544e7e5be4b78378e276f..55fb481945e1fc0665be516b12ee7fcbb0c74431 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 949d2f99dfc48885e102d3dc1b2eb9b1400074ee..bf3d9c9b619215d4ad3be15733d67d042d86e67a 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 1cad8890e1883d9df9ec50c80447da1aa5551f1b..37153399d595ce71ba0653065c6d6630ed5454bd 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 5409635a17ba7bf2ef566c793c51f53b7e190b06..ee7fa62eb24f38867b3952b19ced01c485d0167e 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 12ba3b7bb905d45fe210e50a4134ae7c58501db8..c0eaa4f2d7841a76ffa8b935a8682f3749d9b4e8 100644 (file)
@@ -8,7 +8,6 @@
   -->
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-netconf-${project.version}">
     <feature name="odl-netconf-netty-util" version="${project.version}">
-        <feature version="${karaf.version}">ssh</feature>
-        <feature version="[3.1.0,4)">odl-netty-4</feature>
+        <feature version="[4,5)">odl-apache-sshd</feature>
     </feature>
 </features>
index e342ce6f667a78346559bf0ae6bfc0a5436fcd0f..412d82ea503eac72747966f703ff16f1d16e17f5 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 8a5891b9cd6cc1c314f13fd2245ad9885c22610a..72164f63a6e45c83a46dddef71ad1a2958698c9e 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
@@ -28,7 +28,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>2.6.0-SNAPSHOT</version>
+                <version>3.0.1</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 98549b45f92ff96981cbffab3a12781d5a39444b..1bd5c9e6fb07b58d64240b8f29eaf16f2c280dcd 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index fdade57c51db56dfa67e23f649e6a30acb37a01d..a7370b7299568124be11b28f612c02f8dbe08b47 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index f28f37d9e99f1dc2b7d34e04383238cc44f9f223..fdbdf5534c00a7eb9877a6f3e5e065bae6d1827b 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
     <packaging>feature</packaging>
 
     <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.odlparent</groupId>
+            <artifactId>odl-apache-sshd</artifactId>
+            <type>xml</type>
+            <classifier>features</classifier>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>odl-netconf-mapping-api</artifactId>
@@ -32,7 +38,7 @@
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>odl-yangtools-codec</artifactId>
-            <version>2.0.10</version>
+            <version>2.1.2</version>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index 5e79a30644dd39a4b4c957df9bfde4df61b150ef..11815904516eb8ed9bcad4b97b8aab87b66f9631 100644 (file)
@@ -11,6 +11,6 @@
         <configfile finalname="etc/netconf.cfg">
             mvn:org.opendaylight.netconf/netconf-util/${project.version}/cfg/config
         </configfile>
-        <feature version="[2.0.10,3)">odl-yangtools-codec</feature>
+        <feature version="[2.1,3)">odl-yangtools-codec</feature>
     </feature>
 </features>
index 2a94ada0f3110fd139dd275ab347e1eed0534119..46416ec2f1f9c73e090bdc05c6367e41270501a4 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
index 5a1cbab85c9c6da3622e8e41b1276f5cc9d3b634..1233ce1df875b3b406291d15d3314a5a8a7f1a97 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
index f980956e5b2d6b90a9b6c484a387da4ae3ff1808..e5d2c0fade6c3aa533975d86d47f4cf7a9c3891f 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index f0c7da2ea097d325dca3e2bc6ba998054f468f8c..593c31b456de0666c6a1a57eddc91f62ce894716 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
@@ -32,7 +32,7 @@
         </dependency>
         <dependency>
             <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>odl-guava-23</artifactId>
+            <artifactId>odl-guava</artifactId>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index b289b3b7691bca05792191c42489a6fa03c35fe3..d135db1bdc4c29e3a2c1a1050866680a9cafa336 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 54c869565690bb2c06711a4ed9090712df42458a..7fcbec86b86174e91d8502e9e43ba0f0fb10cfdb 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>feature-repo-parent</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
index e327043319f5788673fae62b269ea8aaf483b61d..6b1f91ae58ea70de907ee2a384a758b94a7109d3 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
@@ -26,8 +26,8 @@
     <dependencies>
         <dependency>
             <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>odl-jackson-2.8</artifactId>
-            <version>3.1.3</version>
+            <artifactId>odl-jackson-2.9</artifactId>
+            <version>4.0.2</version>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index 52ad5e11afd6151f2ef74e0c0d8793d461bcb518..a2f522e779961eef7e86eeec92fe6aaa882ce488 100644 (file)
@@ -8,6 +8,6 @@
   -->
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-netconf-${project.version}">
     <feature name="odl-mdsal-apidocs" version="${project.version}">
-        <feature version="[3.1.0,4)">odl-jackson-2.8</feature>
+        <feature version="[4,5)">odl-jackson-2.9</feature>
     </feature>
 </features>
index 12bfeeeba2d068e75fc75faad9ebe37ed0d3e14f..c75f5ee6da6a01f5db6f81c2262d977e1c2554c6 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 7a3c9e952cf7ab0535730ace33c0cbd1275cdbed..0963a98d485a5e17a4171044cf65fa7f4313ca2a 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
@@ -28,7 +28,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>2.6.0-SNAPSHOT</version>
+                <version>3.0.1</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 8e32b6a7ff070f0037bbe76a02ae896ff3fb9abc..257baf5e944ac28b479c45df71b8db2032318df9 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>2.0.10</version>
+                <version>2.1.2</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>2.6.0-SNAPSHOT</version>
+                <version>3.0.1</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>ietf-restconf</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>rfc7895</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.netconf</groupId>
             <artifactId>ietf-restconf-monitoring</artifactId>
         <!-- TODO: Remove this when RESTCONF is converted to GSON -->
         <dependency>
             <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>odl-jackson-2.8</artifactId>
-            <version>3.1.3</version>
+            <artifactId>odl-jackson-2.9</artifactId>
+            <version>4.0.2</version>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index 6142eb1008b03c2606a9b25aadc0827901bec1ed..35984eb7b4bb5e6e00cfe89678b9750d556faf67 100644 (file)
@@ -8,8 +8,8 @@
   -->
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-netconf-${project.version}">
     <feature name="odl-restconf-common" version="${project.version}">
-        <feature version="[3.1.0,4)">odl-karaf-feat-jetty</feature>
-        <feature version="[3.1.0,4)">odl-jackson-2.8</feature>
-        <feature version="[2.0.10,3)">odl-yangtools-export</feature>
+        <feature version="[4,5)">odl-karaf-feat-jetty</feature>
+        <feature version="[4,5)">odl-jackson-2.9</feature>
+        <feature version="[2.1,3)">odl-yangtools-export</feature>
     </feature>
 </features>
index 6d8b68c6783a3c3ac0e3f8040524e5a43983f370..96b41d20ecbc52f00d320a7a1d1c45b6647da40e 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index f879e33c81b4ba44ab0a93bf9ec2efb08c787735..6a5278109b08caf4d7bd2c845b62de245058e506 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index c86fd811d5cdd2f1106d8a36d0dcda1d52b82dbd..ce776f9f00bfc111aa29337a5f741f3474e99cc2 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 26189cda90886a1d5606ced390b1cbd56849c179..3d05b6e724de22582d09d4e205711461cdd234c1 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index db943789d293f0f876cb67f3c2304479a77fa2bd..df674b122ed8a81ced5d525c04a07ed3cc6384dc 100644 (file)
@@ -8,6 +8,6 @@
   -->
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-netconf-${project.version}">
     <feature name="odl-restconf" version="${project.version}">
-        <feature version="[3.1.0,4)">odl-jackson-2.8</feature>
+        <feature version="[4,5)">odl-jackson-2.9</feature>
     </feature>
 </features>
index a4408ea6079f15aca1be977cdd31a338322545e6..1f8b9e31734b9f6c5a8f08dbae56e2b2aa6a6f39 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
     <artifactId>features-restconf-aggregator</artifactId>
index befc40b7dec9169e4440940e4387edb958120f67..9fb86740a011427e65e8f2ec1bcc81bdc6cea80f 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 12c71d4a39700721139d49f7f9a76a54a5b75ad3..345c4bfe018fddc25bd8525877da20051867adc5 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 9612d4913305dccdb3816ee056293bdf288e2b83..b837020548f65ce35f93285073dc2238075949d8 100644 (file)
@@ -8,6 +8,6 @@
   -->
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-netconf-${project.version}">
     <feature name="odl-yanglib" version="${project.version}">
-        <feature version="[3.1.0,4)">odl-karaf-feat-jetty</feature>
+        <feature version="[4,5)">odl-karaf-feat-jetty</feature>
     </feature>
 </features>
index 366e7f735e14604cad8d00f1b65a1c4edffae5df..2edb401773d0dec0662b3f621584d498304e295a 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index ef3b83d1c6651088720c8a09a1f1ab072f454a2c..735a91a9713249298615910d289969211fb10c89 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>karaf4-parent</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
   <groupId>org.opendaylight.netconf</groupId>
index a3e2db5054fdc11d84096e20cc71ed7a58004a85..62b37ddb72babba6d0e86004d79e4b6cc691c960 100644 (file)
@@ -5,10 +5,11 @@
  * 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.callhome.protocol;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
+import com.google.common.annotations.VisibleForTesting;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
@@ -22,11 +23,10 @@ import org.apache.sshd.client.session.SessionFactory;
 import org.apache.sshd.common.future.SshFutureListener;
 import org.apache.sshd.common.io.IoAcceptor;
 import org.apache.sshd.common.io.IoServiceFactory;
-import org.apache.sshd.common.io.mina.MinaServiceFactory;
-import org.apache.sshd.common.io.nio2.Nio2ServiceFactory;
 import org.apache.sshd.common.kex.KeyExchange;
 import org.apache.sshd.common.session.Session;
 import org.apache.sshd.common.session.SessionListener;
+import org.apache.sshd.netty.NettyIoServiceFactory;
 import org.opendaylight.netconf.callhome.protocol.CallHomeSessionContext.Factory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -35,38 +35,40 @@ public class NetconfCallHomeServer implements AutoCloseable, ServerKeyVerifier {
 
     private static final Logger LOG = LoggerFactory.getLogger(NetconfCallHomeServer.class);
 
-    private final IoAcceptor acceptor;
-    private final SshClient client;
     private final CallHomeAuthorizationProvider authProvider;
-    private final CallHomeSessionContext.Factory sessionFactory;
+    private final IoServiceFactory serviceFactory;
     private final InetSocketAddress bindAddress;
     private final StatusRecorder recorder;
+    private final Factory sessionFactory;
+    private final IoAcceptor acceptor;
+    private final SshClient client;
 
     NetconfCallHomeServer(final SshClient sshClient, final CallHomeAuthorizationProvider authProvider,
             final Factory factory, final InetSocketAddress socketAddress, final StatusRecorder recorder) {
-        this.client = Preconditions.checkNotNull(sshClient);
-        this.authProvider = Preconditions.checkNotNull(authProvider);
-        this.sessionFactory = Preconditions.checkNotNull(factory);
+        this(sshClient, authProvider, factory, socketAddress, recorder,
+            new NettyIoServiceFactory(factory.getNettyGroup()));
+    }
+
+    @VisibleForTesting
+    NetconfCallHomeServer(final SshClient sshClient, final CallHomeAuthorizationProvider authProvider,
+            final Factory factory, final InetSocketAddress socketAddress, final StatusRecorder recorder,
+            final IoServiceFactory serviceFactory) {
+        this.client = requireNonNull(sshClient);
+        this.authProvider = requireNonNull(authProvider);
+        this.sessionFactory = requireNonNull(factory);
         this.bindAddress = socketAddress;
         this.recorder = recorder;
+        this.serviceFactory = requireNonNull(serviceFactory);
 
         sshClient.setServerKeyVerifier(this);
         sshClient.addSessionListener(createSessionListener());
 
-        this.acceptor = createServiceFactory(sshClient).createAcceptor(new SessionFactory(sshClient));
-    }
-
-    private IoServiceFactory createServiceFactory(final SshClient sshClient) {
-        try {
-            return createMinaServiceFactory(sshClient);
-        } catch (NoClassDefFoundError e) {
-            LOG.warn("Mina is not available, defaulting to NIO.");
-            return new Nio2ServiceFactory(sshClient, sshClient.getScheduledExecutorService(), false);
-        }
+        acceptor = serviceFactory.createAcceptor(new SessionFactory(sshClient));
     }
 
-    protected IoServiceFactory createMinaServiceFactory(final SshClient sshClient) {
-        return new MinaServiceFactory(sshClient, sshClient.getScheduledExecutorService(), false);
+    @VisibleForTesting
+    SshClient getClient() {
+        return client;
     }
 
     SessionListener createSessionListener() {
@@ -186,5 +188,6 @@ public class NetconfCallHomeServer implements AutoCloseable, ServerKeyVerifier {
     @Override
     public void close() {
         acceptor.close(true);
+        serviceFactory.close(true);
     }
 }
index decb75968961db396cecac9736788a64fd4197d2..73d4c5b473538ad46a58aa4d6bcf7e5c40c7e066 100644 (file)
@@ -5,12 +5,11 @@
  * 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.callhome.protocol;
 
 import com.google.common.base.Optional;
+import io.netty.channel.DefaultEventLoopGroup;
 import io.netty.channel.EventLoopGroup;
-import io.netty.channel.local.LocalEventLoopGroup;
 import io.netty.util.HashedWheelTimer;
 import java.net.InetSocketAddress;
 import java.util.concurrent.TimeUnit;
@@ -117,7 +116,7 @@ public class NetconfCallHomeServerBuilder implements Builder<NetconfCallHomeServ
     }
 
     private static EventLoopGroup defaultNettyGroup() {
-        return new LocalEventLoopGroup();
+        return new DefaultEventLoopGroup();
     }
 
     private static InetSocketAddress defaultBindAddress() {
index 5832780f4bd4593aecc63234ba4930b306e18492..805b921921cc963021bbcb9033c3ba807eee2c89 100644 (file)
@@ -5,11 +5,10 @@
  * 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.callhome.protocol;
 
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
@@ -21,6 +20,7 @@ import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelOutboundHandlerAdapter;
 import io.netty.channel.ChannelPromise;
+import java.io.IOException;
 import org.apache.sshd.client.channel.ClientChannel;
 import org.apache.sshd.client.session.ClientSession;
 import org.apache.sshd.common.io.IoInputStream;
@@ -39,7 +39,7 @@ public class MinaSshNettyChannelTest {
     private MinaSshNettyChannel instance;
 
     @Before
-    public void setup() {
+    public void setup() throws IOException {
         IoReadFuture mockFuture = mock(IoReadFuture.class);
         IoInputStream mockIn = mock(IoInputStream.class);
         Mockito.doReturn(mockFuture).when(mockIn).read(any(Buffer.class));
@@ -54,7 +54,7 @@ public class MinaSshNettyChannelTest {
         IoWriteFuture mockWrFuture = mock(IoWriteFuture.class);
         Mockito.doReturn(false).when(mockOut).isClosed();
         Mockito.doReturn(false).when(mockOut).isClosing();
-        Mockito.doReturn(mockWrFuture).when(mockOut).write(any(Buffer.class));
+        Mockito.doReturn(mockWrFuture).when(mockOut).writePacket(any(Buffer.class));
         Mockito.doReturn(null).when(mockWrFuture).addListener(any());
 
         Mockito.doReturn(mockFuture).when(mockFuture).addListener(Mockito.any());
index 373a79f7dea47753a69638a472b5433d1eed230d..fa7ff50ddcf280e0d4266af6bec41e8b9694044b 100644 (file)
@@ -9,11 +9,16 @@
 package org.opendaylight.netconf.callhome.protocol;
 
 import static org.junit.Assert.assertFalse;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doNothing;
+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 io.netty.channel.EventLoopGroup;
+import io.netty.channel.nio.NioEventLoopGroup;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
@@ -30,37 +35,62 @@ import org.apache.sshd.common.io.IoHandler;
 import org.apache.sshd.common.io.IoServiceFactory;
 import org.apache.sshd.common.session.Session;
 import org.apache.sshd.common.session.SessionListener;
+import org.junit.AfterClass;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
 import org.mockito.Mockito;
+import org.mockito.junit.MockitoJUnitRunner;
 
+@RunWith(MockitoJUnitRunner.class)
 public class NetconfCallHomeServerTest {
+    private static EventLoopGroup EVENT_LOOP_GROUP;
+    private static InetSocketAddress MOCK_ADDRESS;
+
     private SshClient mockSshClient;
+    @Mock
     private CallHomeAuthorizationProvider mockCallHomeAuthProv;
+    @Mock
     private CallHomeAuthorization mockAuth;
+    @Mock
     private CallHomeSessionContext.Factory mockFactory;
-    private InetSocketAddress mockAddress;
+    @Mock
     private ClientSession mockSession;
+    @Mock
     private StatusRecorder mockStatusRecorder;
 
     private NetconfCallHomeServer instance;
 
+    @BeforeClass
+    public static void beforeClass() {
+        EVENT_LOOP_GROUP = new NioEventLoopGroup();
+        MOCK_ADDRESS = InetSocketAddress.createUnresolved("127.0.0.1", 123);
+    }
+
+    @AfterClass
+    public static void afterClass() {
+        EVENT_LOOP_GROUP.shutdownGracefully();
+        EVENT_LOOP_GROUP = null;
+        MOCK_ADDRESS = null;
+    }
+
     @Before
     public void setup() {
-        mockSshClient = Mockito.spy(SshClient.setUpDefaultClient());
+        mockSshClient = spy(SshClient.setUpDefaultClient());
         mockCallHomeAuthProv = mock(CallHomeAuthorizationProvider.class);
         mockAuth = mock(CallHomeAuthorization.class);
         mockFactory = mock(CallHomeSessionContext.Factory.class);
-        mockAddress = InetSocketAddress.createUnresolved("1.2.3.4", 123);
         mockSession = mock(ClientSession.class);
         mockStatusRecorder = mock(StatusRecorder.class);
 
         Map<String, String> props = new HashMap<>();
         props.put("nio-workers", "1");
-        Mockito.doReturn(props).when(mockSshClient).getProperties();
-        Mockito.doReturn("test").when(mockSession).toString();
+        doReturn(props).when(mockSshClient).getProperties();
+        doReturn(EVENT_LOOP_GROUP).when(mockFactory).getNettyGroup();
         instance = new NetconfCallHomeServer(
-            mockSshClient, mockCallHomeAuthProv, mockFactory, mockAddress, mockStatusRecorder);
+            mockSshClient, mockCallHomeAuthProv, mockFactory, MOCK_ADDRESS, mockStatusRecorder);
     }
 
     @Test
@@ -81,12 +111,12 @@ public class NetconfCallHomeServerTest {
         for (int pass = 0; pass < evt.length; pass++) {
             // given
             AuthFuture mockAuthFuture = mock(AuthFuture.class);
-            Mockito.doReturn(null).when(mockAuthFuture).addListener(any(SshFutureListener.class));
+            doReturn(null).when(mockAuthFuture).addListener(any(SshFutureListener.class));
             CallHomeSessionContext mockContext = mock(CallHomeSessionContext.class);
-            Mockito.doNothing().when(mockContext).openNetconfChannel();
-            Mockito.doReturn(mockContext).when(mockSession).getAttribute(any(Session.AttributeKey.class));
+            doNothing().when(mockContext).openNetconfChannel();
+            doReturn(mockContext).when(mockSession).getAttribute(any(Session.AttributeKey.class));
             SessionListener listener = instance.createSessionListener();
-            Mockito.doReturn(mockAuthFuture).when(mockContext).authorize();
+            doReturn(mockAuthFuture).when(mockContext).authorize();
             // when
             listener.sessionEvent(mockSession, evt[pass]);
             // then
@@ -102,10 +132,8 @@ public class NetconfCallHomeServerTest {
         ClientSessionImpl mockClientSession = mock(ClientSessionImpl.class);
         Mockito.doReturn("test").when(mockClientSession).toString();
         SocketAddress mockSocketAddr = mock(SocketAddress.class);
-        Mockito.doReturn("testAddr").when(mockSocketAddr).toString();
         PublicKey mockPublicKey = mock(PublicKey.class);
 
-        Mockito.doReturn("test").when(mockAuth).toString();
         Mockito.doReturn(true).when(mockAuth).isServerAllowed();
         Mockito.doReturn("some-session-name").when(mockAuth).getSessionName();
 
@@ -133,29 +161,6 @@ public class NetconfCallHomeServerTest {
         assertFalse(instance.verifyServerKey(mockClientSession, mockSocketAddr, mockPublicKey));
     }
 
-    static class TestableCallHomeServer extends NetconfCallHomeServer {
-        static IoServiceFactory minaServiceFactory;
-
-        static SshClient factoryHook(final SshClient client, final IoServiceFactory minaFactory) {
-            minaServiceFactory = minaFactory;
-            return client;
-        }
-
-        SshClient client;
-
-        TestableCallHomeServer(final SshClient sshClient, final CallHomeAuthorizationProvider authProvider,
-                               final CallHomeSessionContext.Factory factory, final InetSocketAddress socketAddress,
-                               final IoServiceFactory minaFactory, final StatusRecorder recorder) {
-            super(factoryHook(sshClient, minaFactory), authProvider, factory, socketAddress, recorder);
-            client = sshClient;
-        }
-
-        @Override
-        protected IoServiceFactory createMinaServiceFactory(final SshClient sshClient) {
-            return minaServiceFactory;
-        }
-    }
-
     @Test
     public void bindShouldStartTheClientAndBindTheAddress() throws IOException {
         // given
@@ -163,14 +168,13 @@ public class NetconfCallHomeServerTest {
         IoServiceFactory mockMinaFactory = mock(IoServiceFactory.class);
 
         Mockito.doReturn(mockAcceptor).when(mockMinaFactory).createAcceptor(any(IoHandler.class));
-        Mockito.doReturn(mockAcceptor).when(mockMinaFactory).createAcceptor(any(IoHandler.class));
-        Mockito.doNothing().when(mockAcceptor).bind(mockAddress);
-        instance = new TestableCallHomeServer(
-            mockSshClient, mockCallHomeAuthProv, mockFactory, mockAddress, mockMinaFactory, mockStatusRecorder);
+        Mockito.doNothing().when(mockAcceptor).bind(any(SocketAddress.class));
+        instance = new NetconfCallHomeServer(
+                mockSshClient, mockCallHomeAuthProv, mockFactory, MOCK_ADDRESS, mockStatusRecorder, mockMinaFactory);
         // when
         instance.bind();
         // then
         verify(mockSshClient, times(1)).start();
-        verify(mockAcceptor, times(1)).bind(mockAddress);
+        verify(mockAcceptor, times(1)).bind(MOCK_ADDRESS);
     }
 }
index 30a10cd5fa5e62b5a4bdc28ceccd426bd0dfb63c..8bb21ffa51b3582add48ef346dafd5ec00a5d70f 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.netconf.callhome.mount;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.ListenableFuture;
+import io.netty.channel.nio.NioEventLoopGroup;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.util.Collection;
@@ -106,6 +107,7 @@ public class IetfZeroTouchCallHomeServerProvider implements AutoCloseable, DataT
         if (port > 0) {
             builder.setBindAddress(new InetSocketAddress(port));
         }
+        builder.setNettyGroup(new NioEventLoopGroup());
         server = builder.build();
         server.bind();
         mountDispacher.createTopology();
index 488d7e71b97a96f4ae7c78e83a4ee9e27e0cc7dc..6706a7a765d348ec4ad2382d7e25bdd4384035c7 100644 (file)
@@ -81,8 +81,8 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>xmlunit</groupId>
-      <artifactId>xmlunit</artifactId>
+      <groupId>org.xmlunit</groupId>
+      <artifactId>xmlunit-legacy</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
index 6ffb450bc9a2ab2515b42a80f6bd89abbda76ee3..ce4fd13a3a85c3e444c4b345c7e4071798c68a53 100644 (file)
@@ -7,7 +7,5 @@
   -->
 
 <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" a="64" id="a" message-id="101" xmlnx="a:b:c:d">
-    <data>
-        <top xmlns="urn:opendaylight:mdsal:mapping:test"/>
-    </data>
-</rpc-reply>
\ No newline at end of file
+    <data/>
+</rpc-reply>
index 9d785eedde83ba4c01ba9e24b6bf8d15ffb9f071..8f4169752828e5ee4838a5f358de768b18e71d22 100755 (executable)
@@ -67,7 +67,6 @@
         <argument ref="sessionIdProvider"/>
         <argument value="${connection-timeout-millis}"/>
         <argument ref="netconfMonitoringService"/>
-        <argument><null/></argument><!--Base capabilities-->
     </bean>
 
     <bean id="serverChannelInitializer"
index d5f761eefa76e7601d510f5446ba14b08b6c438c..20df5db8cbd0bf1d5fca2be420f7229f16552719 100644 (file)
@@ -58,8 +58,8 @@
       <artifactId>mockito-configuration</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-inet-types-2013-07-15</artifactId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+      <artifactId>rfc6991-ietf-inet-types</artifactId>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
index 7d624366102da45142c19a340745e43dc6f06563..f88ca7ab30c6452fc64e5b1a378b2b886d1c424a 100644 (file)
             <artifactId>sal-binding-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-inet-types-2013-07-15</artifactId>
+            <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+            <artifactId>rfc6991-ietf-inet-types</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
+            <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
             <artifactId>rfc7895</artifactId>
         </dependency>
         <dependency>
index 177cb704eec8ed10249ca748b6350ab00f4b8f2a..5ef20aeb544268bbc34d12b8233d16aff384b715 100644 (file)
@@ -63,9 +63,7 @@ class NetconfEventSourceMount {
         final ModuleInfoBackedContext moduleInfoBackedContext = ModuleInfoBackedContext.create();
         moduleInfoBackedContext.addModuleInfos(Collections.singletonList(org.opendaylight.yang.gen.v1.urn.ietf.params
                 .xml.ns.netmod.notification.rev080714.$YangModuleInfoImpl.getInstance()));
-        final Optional<SchemaContext> schemaContextOptional = moduleInfoBackedContext.tryToCreateSchemaContext();
-        Preconditions.checkState(schemaContextOptional.isPresent());
-        SchemaContext notificationsSchemaCtx = schemaContextOptional.get();
+        SchemaContext notificationsSchemaCtx = moduleInfoBackedContext.tryToCreateSchemaContext().get();
 
         final JavassistUtils javassist = JavassistUtils.forClassPool(ClassPool.getDefault());
         CODEC_REGISTRY = new BindingNormalizedNodeCodecRegistry(StreamWriterGenerator.create(javassist));
@@ -89,7 +87,7 @@ class NetconfEventSourceMount {
         this.dataBroker = getService(mountPoint, DOMDataBroker.class);
     }
 
-    private static <T extends DOMService> T getService(DOMMountPoint mountPoint, Class<T> service) {
+    private static <T extends DOMService> T getService(final DOMMountPoint mountPoint, final Class<T> service) {
         final Optional<T> optional = mountPoint.getService(service);
         Preconditions.checkState(optional.isPresent(), "Service not present on mount point: %s", service.getName());
         return optional.get();
@@ -166,8 +164,8 @@ class NetconfEventSourceMount {
      * @return ListenerRegistration
      * @see DOMNotificationService#registerNotificationListener(DOMNotificationListener, SchemaPath...)
      */
-    ListenerRegistration<DOMNotificationListener> registerNotificationListener(DOMNotificationListener listener,
-                                                                               SchemaPath notificationPath) {
+    ListenerRegistration<DOMNotificationListener> registerNotificationListener(final DOMNotificationListener listener,
+                                                                               final SchemaPath notificationPath) {
         return notificationService.registerNotificationListener(listener, notificationPath);
     }
 
index ef1ef3e4dff3d11d0724e5507a397215d6ed49dd..2c9cc9188ce014f22c5d0ba457618da35cdffe7c 100644 (file)
 
   <dependencies>
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-inet-types-2013-07-15</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-yang-types-20130715</artifactId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+      <artifactId>rfc6991</artifactId>
     </dependency>
   </dependencies>
 </project>
index 34406c4cd5581239ddd23f0922bb2e5e621b01b6..e2ab8493c7724827a6335c924ef56a45fab5e6ad 100644 (file)
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-yang-types-20130715</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-inet-types-2013-07-15</artifactId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+      <artifactId>rfc6991</artifactId>
     </dependency>
   </dependencies>
 </project>
index e300ff626a0a4b0717f20469a7754bc4db569cce..77080eedf5cbc58f5ac5b7bfc5d26cbec02ddf97 100644 (file)
@@ -24,8 +24,8 @@
 
     <dependencies>
         <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-inet-types-2013-07-15</artifactId>
+            <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+            <artifactId>rfc6991-ietf-inet-types</artifactId>
         </dependency>
     </dependencies>
 </project>
index f9d6ae80cb15a5d4ff9908667cf7f78e1ce2f0d8..855497d754f6f200d08d4cf2fde5e0faf0d77966 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
index f60435d2846187744f03652cf0935d8ba612847c..51d2063d2ef9dc64e397d36d8f6dfb8486bebe29 100644 (file)
       <artifactId>protocol-framework</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-inet-types-2013-07-15</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-yang-types-20130715</artifactId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+      <artifactId>rfc6991</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
@@ -52,8 +48,8 @@
       <artifactId>mockito-configuration</artifactId>
     </dependency>
     <dependency>
-      <groupId>xmlunit</groupId>
-      <artifactId>xmlunit</artifactId>
+      <groupId>org.xmlunit</groupId>
+      <artifactId>xmlunit-legacy</artifactId>
       <scope>test</scope>
     </dependency>
   </dependencies>
index 8b47380730b80dab5f4f187afd1677a0533b36cd..3befd836ad345a10877002726a06260e41fa2c8b 100644 (file)
@@ -14,7 +14,7 @@
     <parent>
       <groupId>org.opendaylight.odlparent</groupId>
       <artifactId>odlparent-lite</artifactId>
-      <version>3.1.3</version>
+      <version>4.0.2</version>
       <relativePath/>
     </parent>
 
index 45019fede49267a05b1ec864e1994c2a8b5c0114..3a1e0d702468e73bc383368ed5e2bcee68a878c8 100644 (file)
@@ -9,7 +9,7 @@
 package org.opendaylight.netconf.client;
 
 import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
 
 import io.netty.channel.Channel;
@@ -47,6 +47,8 @@ public class NetconfClientDispatcherImplTest {
         ChannelPromise promise = Mockito.mock(ChannelPromise.class);
         doReturn(promise).when(chf).addListener(any(GenericFutureListener.class));
         doReturn(thr).when(chf).cause();
+        doReturn(true).when(chf).isDone();
+        doReturn(false).when(chf).isSuccess();
 
         Long timeout = 200L;
         NetconfHelloMessageAdditionalHeader header =
index 7b84cb0be481ae9ff77e7706a40923774718e704..b25de514c7f8acb8ff43fbea61c8a51c6f98e3aa 100644 (file)
@@ -8,12 +8,11 @@
 
 package org.opendaylight.netconf.client;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.anyString;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
@@ -30,6 +29,7 @@ import io.netty.channel.ChannelPipeline;
 import io.netty.channel.ChannelProgressivePromise;
 import io.netty.channel.ChannelPromise;
 import io.netty.channel.EventLoop;
+import io.netty.handler.codec.MessageToByteEncoder;
 import io.netty.handler.ssl.SslHandler;
 import io.netty.util.HashedWheelTimer;
 import io.netty.util.Timer;
@@ -46,6 +46,7 @@ import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.xml.XmlUtil;
 import org.opendaylight.netconf.nettyutil.handler.ChunkedFramingMechanismEncoder;
+import org.opendaylight.netconf.nettyutil.handler.NetconfEXIToMessageDecoder;
 import org.opendaylight.netconf.nettyutil.handler.NetconfXMLToHelloMessageDecoder;
 import org.opendaylight.netconf.nettyutil.handler.NetconfXMLToMessageDecoder;
 import org.opendaylight.netconf.nettyutil.handler.exi.EXIParameters;
@@ -82,8 +83,8 @@ public class NetconfClientSessionNegotiatorTest {
         doReturn("").when(ret).toString();
         doReturn(future).when(ret).newPromise();
         doReturn(future).when(ret).close();
-        doReturn(future).when(ret).writeAndFlush(anyObject());
-        doReturn(future).when(ret).writeAndFlush(anyObject(), anyObject());
+        doReturn(future).when(ret).writeAndFlush(any());
+        doReturn(future).when(ret).writeAndFlush(any(), any());
         doReturn(true).when(ret).isOpen();
         doReturn(pipeline).when(ret).pipeline();
         doReturn("").when(pipeline).toString();
@@ -107,10 +108,14 @@ public class NetconfClientSessionNegotiatorTest {
         doReturn(handler).when(pipeline).replace(anyString(), anyString(), any(ChunkedFramingMechanismEncoder.class));
 
         NetconfXMLToHelloMessageDecoder messageDecoder = new NetconfXMLToHelloMessageDecoder();
-        doReturn(messageDecoder).when(pipeline).replace(anyString(), anyString(), any(NetconfXMLToMessageDecoder
-                .class));
-        doReturn(pipeline).when(pipeline).replace(any(ChannelHandler.class), anyString(), any(NetconfClientSession
-                .class));
+        doReturn(messageDecoder).when(pipeline).replace(anyString(), anyString(),
+            any(NetconfXMLToMessageDecoder.class));
+        doReturn(pipeline).when(pipeline).replace(any(ChannelHandler.class), anyString(),
+            any(NetconfClientSession.class));
+        doReturn(null).when(pipeline).replace(anyString(), anyString(),
+            any(MessageToByteEncoder.class));
+        doReturn(null).when(pipeline).replace(anyString(), anyString(),
+            any(NetconfEXIToMessageDecoder.class));
         return pipeline;
     }
 
@@ -118,7 +123,7 @@ public class NetconfClientSessionNegotiatorTest {
         final EventLoop eventLoop = mock(EventLoop.class);
         doReturn(eventLoop).when(channel).eventLoop();
         doAnswer(invocation -> {
-            invocation.getArgumentAt(0, Runnable.class).run();
+            invocation.<Runnable>getArgument(0).run();
             return null;
         }).when(eventLoop).execute(any(Runnable.class));
     }
@@ -152,21 +157,21 @@ public class NetconfClientSessionNegotiatorTest {
     @Test
     public void testNetconfClientSessionNegotiator() throws NetconfDocumentedException {
         Promise<NetconfClientSession> promise = mock(Promise.class);
-        doReturn(promise).when(promise).setSuccess(anyObject());
+        doReturn(promise).when(promise).setSuccess(any());
         NetconfClientSessionNegotiator negotiator = createNetconfClientSessionNegotiator(promise, null);
 
         negotiator.channelActive(null);
         Set<String> caps = Sets.newSet("a", "b");
         NetconfHelloMessage helloServerMessage = NetconfHelloMessage.createServerHello(caps, 10);
         negotiator.handleMessage(helloServerMessage);
-        verify(promise).setSuccess(anyObject());
+        verify(promise).setSuccess(any());
     }
 
     @Test
     public void testNegotiatorWhenChannelActiveHappenAfterHandleMessage() throws Exception {
         Promise promise = mock(Promise.class);
         doReturn(false).when(promise).isDone();
-        doReturn(promise).when(promise).setSuccess(anyObject());
+        doReturn(promise).when(promise).setSuccess(any());
         NetconfClientSessionNegotiator negotiator = createNetconfClientSessionNegotiator(promise, null);
         Set<String> caps = Sets.newSet("a", "b");
         NetconfHelloMessage helloServerMessage = NetconfHelloMessage.createServerHello(caps, 10);
@@ -174,7 +179,7 @@ public class NetconfClientSessionNegotiatorTest {
         negotiator.handleMessage(helloServerMessage);
         negotiator.channelActive(null);
 
-        verify(promise).setSuccess(anyObject());
+        verify(promise).setSuccess(any());
     }
 
 
@@ -182,7 +187,7 @@ public class NetconfClientSessionNegotiatorTest {
     public void testNetconfClientSessionNegotiatorWithEXI() throws Exception {
         Promise<NetconfClientSession> promise = mock(Promise.class);
         NetconfStartExiMessage exiMessage = NetconfStartExiMessage.create(EXIParameters.empty(), "msg-id");
-        doReturn(promise).when(promise).setSuccess(anyObject());
+        doReturn(promise).when(promise).setSuccess(any());
         NetconfClientSessionNegotiator negotiator = createNetconfClientSessionNegotiator(promise, exiMessage);
 
         negotiator.channelActive(null);
@@ -190,7 +195,7 @@ public class NetconfClientSessionNegotiatorTest {
         NetconfHelloMessage message = NetconfHelloMessage.createServerHello(caps, 10);
 
         doAnswer(invocationOnMock -> {
-            channelInboundHandlerAdapter = (ChannelInboundHandlerAdapter) invocationOnMock.getArguments()[2];
+            channelInboundHandlerAdapter = invocationOnMock.getArgument(2);
             return null;
         }).when(pipeline).addAfter(anyString(), anyString(), any(ChannelHandler.class));
 
@@ -200,7 +205,7 @@ public class NetconfClientSessionNegotiatorTest {
         Document expectedResult = XmlFileLoader.xmlFileToDocument("netconfMessages/rpc-reply_ok.xml");
         channelInboundHandlerAdapter.channelRead(handlerContext, new NetconfMessage(expectedResult));
 
-        verify(promise).setSuccess(anyObject());
+        verify(promise).setSuccess(any());
 
         // two calls for exiMessage, 2 for hello message
         verify(pipeline, times(4)).replace(anyString(), anyString(), any(ChannelHandler.class));
@@ -209,7 +214,7 @@ public class NetconfClientSessionNegotiatorTest {
     @Test
     public void testNetconfClientSessionNegotiatorGetCached() throws Exception {
         Promise promise = mock(Promise.class);
-        doReturn(promise).when(promise).setSuccess(anyObject());
+        doReturn(promise).when(promise).setSuccess(any());
         NetconfClientSessionListener sessionListener = mock(NetconfClientSessionListener.class);
         NetconfClientSessionNegotiator negotiator = createNetconfClientSessionNegotiator(promise, null);
 
index 68c1a762f079d47bb062f64cfe4e58f877200f28..ec891fcbdd77196c6eb21e7bd7e5883598f5bd9f 100644 (file)
@@ -61,7 +61,7 @@ public class SimpleNetconfClientSessionListenerTest {
         final EventLoop eventLoop = mock(EventLoop.class);
         doReturn(eventLoop).when(channel).eventLoop();
         doAnswer(invocation -> {
-            invocation.getArgumentAt(0, Runnable.class).run();
+            invocation.<Runnable>getArgument(0).run();
             return null;
         }).when(eventLoop).execute(any(Runnable.class));
     }
index a57a3c51adb48aa776c884f8611a8d99a49478fb..577341f5203f9649106c1e16f53ad0fbde72a2b2 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>bundle-parent</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
index 2ceb0668080de191c7555eb26341f4698dcb16c5..ccbcc41a6053f4c6406792332390c57ec9048bb3 100644 (file)
@@ -10,8 +10,9 @@ package org.opendaylight.netconf.console.commands;
 
 import static junit.framework.TestCase.assertEquals;
 import static junit.framework.TestCase.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
@@ -122,7 +123,7 @@ public class NetconfCommandsImplCallsTest {
 
         netconfUpdateDeviceCommand.execute();
 
-        verify(netconfCommands, times(1)).updateDevice(anyString(), anyString(), anyString(),
+        verify(netconfCommands, times(1)).updateDevice(isNull(), isNull(), isNull(),
                 hashMapArgumentCaptor.capture());
 
         assertTrue(hashMapArgumentCaptor.getValue().containsKey(NetconfConsoleConstants.NETCONF_IP));
index b1c3457fb4f9596138426a0ac048acb1c50cfa22..c617dd19c23e05c007155724b7894fa099bcf4cc 100644 (file)
     </dependency>
 
     <dependency>
-      <groupId>xmlunit</groupId>
-      <artifactId>xmlunit</artifactId>
+      <groupId>org.xmlunit</groupId>
+      <artifactId>xmlunit-legacy</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
index 3dfd48b656dbd2123eb2611e9edad66429dc0dc5..dbe9c0b7eec61114cb47e8319979f8bd34361926 100644 (file)
@@ -30,8 +30,6 @@ import org.opendaylight.protocol.framework.SessionNegotiator;
 import org.opendaylight.protocol.framework.SessionNegotiatorFactory;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Capabilities;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorFactory<NetconfHelloMessage,
         NetconfServerSession, NetconfServerSessionListener> {
@@ -48,9 +46,15 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
     private final NetconfOperationServiceFactory aggregatedOpService;
     private final long connectionTimeoutMillis;
     private final NetconfMonitoringService monitoringService;
-    private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionNegotiatorFactory.class);
     private final Set<String> baseCapabilities;
 
+    public NetconfServerSessionNegotiatorFactory(final Timer timer,
+            final NetconfOperationServiceFactory netconfOperationProvider,
+            final SessionIdProvider idProvider, final long connectionTimeoutMillis,
+            final NetconfMonitoringService monitoringService) {
+        this(timer, netconfOperationProvider, idProvider, connectionTimeoutMillis, monitoringService, null);
+    }
+
     public NetconfServerSessionNegotiatorFactory(final Timer timer,
                                                  final NetconfOperationServiceFactory netconfOperationProvider,
                                                  final SessionIdProvider idProvider, final long connectionTimeoutMillis,
@@ -65,7 +69,6 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
                 baseCapabilities);
     }
 
-
     private static ImmutableSet<String> validateBaseCapabilities(final Set<String> baseCapabilities) {
         // Check base capabilities to be supported by the server
         final Sets.SetView<String> unknownBaseCaps = Sets.difference(baseCapabilities, DEFAULT_BASE_CAPABILITIES);
@@ -111,7 +114,6 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
         final NetconfOperationRouter operationRouter =
                 new NetconfOperationRouterImpl(service, monitoringService, netconfSessionIdForReporting);
         return new NetconfServerSessionListener(operationRouter, monitoringService, service);
-
     }
 
     protected NetconfOperationService getOperationServiceForAddress(final String netconfSessionIdForReporting,
@@ -132,5 +134,4 @@ public class NetconfServerSessionNegotiatorFactory implements SessionNegotiatorF
     public static Set<String> transformCapabilities(final Capabilities capabilities) {
         return Sets.newHashSet(Collections2.transform(capabilities.getCapability(), Uri::getValue));
     }
-
 }
index e7d5bb3e2daa4f3f6f5142bfae31401872c0f738..316bfd3eb84a0a30f80a4132235f202157f43f41 100644 (file)
@@ -8,8 +8,8 @@
 
 package org.opendaylight.netconf.impl;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.argThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.argThat;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
@@ -18,11 +18,11 @@ import static org.mockito.Mockito.verify;
 import io.netty.channel.embedded.EmbeddedChannel;
 import org.custommonkey.xmlunit.Diff;
 import org.custommonkey.xmlunit.XMLUnit;
-import org.hamcrest.CustomMatcher;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.mockito.ArgumentMatcher;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.netconf.api.NetconfMessage;
@@ -154,17 +154,7 @@ public class NetconfServerSessionListenerTest {
         verify(monitoringListener).onSessionEvent(argThat(sessionEventIs(SessionEvent.Type.NOTIFICATION)));
     }
 
-    private CustomMatcher<SessionEvent> sessionEventIs(final SessionEvent.Type type) {
-        return new CustomMatcher<SessionEvent>(type.name()) {
-            @Override
-            public boolean matches(final Object item) {
-                if (!(item instanceof SessionEvent)) {
-                    return false;
-                }
-                final SessionEvent e = (SessionEvent) item;
-                return e.getType().equals(type) && e.getSession().equals(session);
-            }
-        };
+    private ArgumentMatcher<SessionEvent> sessionEventIs(final SessionEvent.Type type) {
+        return event -> event.getType().equals(type) && event.getSession().equals(session);
     }
-
 }
index 12933294560cc45eef84a371cf960b5a98ac5e88..deddd88033b2cb765d6b9f88e285052782dc3a34 100644 (file)
@@ -8,8 +8,8 @@
 
 package org.opendaylight.netconf.impl.mapping.operations;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyObject;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyObject;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
@@ -40,7 +40,7 @@ public class DefaultCloseSessionTest {
         final EventLoop eventLoop = mock(EventLoop.class);
         doReturn(eventLoop).when(channel).eventLoop();
         doAnswer(invocation -> {
-            invocation.getArgumentAt(0, Runnable.class).run();
+            invocation.<Runnable>getArgument(0).run();
             return null;
         }).when(eventLoop).execute(any(Runnable.class));
         doReturn(true).when(eventLoop).inEventLoop();
@@ -62,7 +62,7 @@ public class DefaultCloseSessionTest {
 
         final ChannelPromise sendFuture = mock(ChannelPromise.class);
         doAnswer(invocation -> {
-            invocation.getArgumentAt(0, GenericFutureListener.class).operationComplete(sendFuture);
+            invocation.<GenericFutureListener>getArgument(0).operationComplete(sendFuture);
             return null;
         }).when(sendFuture).addListener(any(GenericFutureListener.class));
         doReturn(sendFuture).when(channel).newPromise();
index 5f8c6d2aa46f858c39d21e330b298b2d9adc8ea2..4e6a94c083c53bc6f5154721049a51caafc0ed4b 100644 (file)
@@ -8,8 +8,8 @@
 
 package org.opendaylight.netconf.impl.osgi;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.anyString;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.verify;
@@ -36,17 +36,22 @@ public class NetconfImplActivatorTest {
     private ServiceReference<?> reference;
     @Mock
     private ServiceRegistration<?> registration;
+    @Mock
+    private ServiceRegistration<?> monRegistration;
 
     @Before
     public void setUp() throws Exception {
         MockitoAnnotations.initMocks(this);
         doReturn(filter).when(bundle).createFilter(anyString());
-        doNothing().when(bundle).addServiceListener(any(ServiceListener.class), anyString());
+        doNothing().when(bundle).addServiceListener(any(ServiceListener.class), any());
 
         ServiceReference<?>[] refs = {};
-        doReturn(refs).when(bundle).getServiceReferences(anyString(), anyString());
-        doReturn(Arrays.asList(refs)).when(bundle).getServiceReferences(any(Class.class), anyString());
+        doReturn(refs).when(bundle).getServiceReferences(anyString(), any());
+        doReturn(Arrays.asList(refs)).when(bundle).getServiceReferences(any(Class.class), any());
         doReturn("").when(bundle).getProperty(anyString());
+        doReturn(monRegistration).when(bundle).registerService(any(Class.class),
+            any(NetconfMonitoringServiceImpl.class), any(Dictionary.class));
+        doNothing().when(monRegistration).unregister();
         doReturn(registration).when(bundle).registerService(any(Class.class),
                 any(AggregatedNetconfOperationServiceFactory.class), any(Dictionary.class));
         doNothing().when(registration).unregister();
@@ -57,7 +62,7 @@ public class NetconfImplActivatorTest {
     public void testStart() throws Exception {
         NetconfImplActivator activator = new NetconfImplActivator();
         activator.start(bundle);
-        verify(bundle).registerService(any(Class.class), any(AggregatedNetconfOperationServiceFactory.class),
+        verify(bundle).registerService(any(Class.class), any(NetconfMonitoringServiceImpl.class),
                 any(Dictionary.class));
         activator.stop(bundle);
     }
index 0b184088dae67a7f8143b23383abf06fcc3902fc..66f3c5ffd0480fd387f76d3a603db6d3aae9d684 100644 (file)
@@ -47,8 +47,8 @@
       <artifactId>mockito-configuration</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-inet-types-2013-07-15</artifactId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+      <artifactId>rfc6991-ietf-inet-types</artifactId>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
index 6bf3be9f9eef60591fe4769e800e950398e02002..c80937bb15ef3ffd962859625e27748a332d43e4 100644 (file)
@@ -8,8 +8,8 @@
 
 package org.opendaylight.netconf.monitoring.osgi;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
@@ -39,7 +39,7 @@ public class NetconfMonitoringActivatorTest {
         doNothing().when(context).addServiceListener(any(ServiceListener.class), anyString());
         ServiceReference<?>[] refs = new ServiceReference[2];
         doReturn(Arrays.asList(refs)).when(context).getServiceReferences(any(Class.class), anyString());
-        doReturn(refs).when(context).getServiceReferences(anyString(), anyString());
+        doReturn(refs).when(context).getServiceReferences(anyString(), any());
         doNothing().when(context).removeServiceListener(any(ServiceListener.class));
     }
 
index ad1c0ce31202c33f6237e5f814887b9635d868a1..0f7254bd24d7b444bd09586ace16dffd56360da8 100644 (file)
     <dependency>
       <groupId>org.apache.sshd</groupId>
       <artifactId>sshd-core</artifactId>
-      <version>1.6.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sshd</groupId>
+      <artifactId>sshd-netty</artifactId>
     </dependency>
     <dependency>
       <groupId>com.siemens.ct.exi</groupId>
@@ -73,8 +76,8 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>xmlunit</groupId>
-      <artifactId>xmlunit</artifactId>
+      <groupId>org.xmlunit</groupId>
+      <artifactId>xmlunit-legacy</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
index 96e54942dfac06cc9d9a779ea8a1f4e0ad5e83c2..f35372742e9b3aa7f4c54bc6fe6fd05dbab71be9 100644 (file)
@@ -12,6 +12,7 @@ import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelPromise;
+import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.util.Deque;
 import java.util.LinkedList;
@@ -85,7 +86,7 @@ public final class AsyncSshHandlerWriter implements AutoCloseable {
             if (LOG.isTraceEnabled()) {
                 LOG.trace("Writing request on channel: {}, message: {}", ctx.channel(), byteBufToString(byteBufMsg));
             }
-            asyncIn.write(toBuffer(byteBufMsg)).addListener(future -> {
+            asyncIn.writePacket(toBuffer(byteBufMsg)).addListener(future -> {
                 // synchronized block due to deadlock that happens on ssh window resize
                 // writes and pending writes would lock the underlyinch channel session
                 // window resize write would try to write the message on an already locked channelSession,
@@ -122,8 +123,7 @@ public final class AsyncSshHandlerWriter implements AutoCloseable {
                 writePendingIfAny();
             });
 
-        } catch (final WritePendingException e) {
-
+        } catch (final IOException | WritePendingException e) {
             if (!wasPending) {
                 queueRequest(ctx, byteBufMsg, promise);
             }
index 3626fc008bd453a2fc80f83e81dd25aefe559c37..e978850545723143994c59433012d6447dd4dd5b 100644 (file)
@@ -9,8 +9,8 @@
 package org.opendaylight.netconf.nettyutil;
 
 import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
@@ -80,7 +80,7 @@ public class AbstractNetconfSessionTest {
 
         doReturn(eventLoop).when(channel).eventLoop();
         doAnswer(invocation -> {
-            invocation.getArgumentAt(0, Runnable.class).run();
+            invocation.<Runnable>getArgument(0).run();
             return null;
         }).when(eventLoop).execute(any(Runnable.class));
 
index 4023ece6dbd67311262e16961aeb4b70c3ad89a2..bec8a3e021c571e68e9a176d9220cdbeef4b4017 100644 (file)
@@ -5,13 +5,12 @@
  * 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.nettyutil.handler.ssh.client;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyObject;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
@@ -57,7 +56,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
-import org.mockito.Matchers;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
@@ -218,8 +216,7 @@ public class AsyncSshHandlerTest {
             @Override
             public void onSuccess(final SshFutureListener<IoReadFuture> result) {
                 doReturn(new IllegalStateException()).when(mockedReadFuture).getException();
-                doReturn(mockedReadFuture).when(mockedReadFuture)
-                        .removeListener(Matchers.any());
+                doReturn(mockedReadFuture).when(mockedReadFuture).removeListener(any());
                 doReturn(true).when(asyncOut).isClosing();
                 doReturn(true).when(asyncOut).isClosed();
                 result.operationComplete(mockedReadFuture);
@@ -249,8 +246,7 @@ public class AsyncSshHandlerTest {
             @Override
             public void onSuccess(final SshFutureListener<IoReadFuture> result) {
                 doReturn(new IllegalStateException()).when(mockedReadFuture).getException();
-                doReturn(mockedReadFuture).when(mockedReadFuture)
-                        .removeListener(Matchers.any());
+                doReturn(mockedReadFuture).when(mockedReadFuture).removeListener(any());
                 result.operationComplete(mockedReadFuture);
             }
         }, MoreExecutors.directExecutor());
@@ -294,7 +290,7 @@ public class AsyncSshHandlerTest {
         final IoInputStream asyncOut = getMockedIoInputStream();
         final IoOutputStream asyncIn = getMockedIoOutputStream();
 
-        final IoWriteFuture ioWriteFuture = asyncIn.write(null);
+        final IoWriteFuture ioWriteFuture = asyncIn.writePacket(new ByteArrayBuffer());
 
         Futures.addCallback(stubAddListener(ioWriteFuture), new SuccessFutureListener<IoWriteFuture>() {
             @Override
@@ -327,7 +323,7 @@ public class AsyncSshHandlerTest {
 
         final IoInputStream asyncOut = getMockedIoInputStream();
         final IoOutputStream asyncIn = getMockedIoOutputStream();
-        final IoWriteFuture ioWriteFuture = asyncIn.write(null);
+        final IoWriteFuture ioWriteFuture = asyncIn.writePacket(new ByteArrayBuffer());
 
         final ChannelSubsystem subsystemChannel = getMockedSubsystemChannel(asyncOut, asyncIn);
         final ClientSession sshSession = getMockedSshSession(subsystemChannel);
@@ -351,10 +347,10 @@ public class AsyncSshHandlerTest {
 
         final ChannelPromise secondWritePromise = getMockedPromise();
         // now make write throw pending exception
-        doThrow(org.apache.sshd.common.io.WritePendingException.class).when(asyncIn).write(any(Buffer.class));
+        doThrow(org.apache.sshd.common.io.WritePendingException.class).when(asyncIn).writePacket(any(Buffer.class));
         asyncSshHandler.write(ctx, Unpooled.copiedBuffer(new byte[]{0, 1, 2, 3, 4, 5}), secondWritePromise);
 
-        doReturn(ioWriteFuture).when(asyncIn).write(any(Buffer.class));
+        doReturn(ioWriteFuture).when(asyncIn).writePacket(any(Buffer.class));
 
         verifyZeroInteractions(firstWritePromise, secondWritePromise);
 
@@ -376,7 +372,7 @@ public class AsyncSshHandlerTest {
 
         final IoInputStream asyncOut = getMockedIoInputStream();
         final IoOutputStream asyncIn = getMockedIoOutputStream();
-        final IoWriteFuture ioWriteFuture = asyncIn.write(null);
+        final IoWriteFuture ioWriteFuture = asyncIn.writePacket(new ByteArrayBuffer());
 
         final ChannelSubsystem subsystemChannel = getMockedSubsystemChannel(asyncOut, asyncIn);
         final ClientSession sshSession = getMockedSshSession(subsystemChannel);
@@ -396,7 +392,7 @@ public class AsyncSshHandlerTest {
 
         final ChannelPromise secondWritePromise = getMockedPromise();
         // now make write throw pending exception
-        doThrow(org.apache.sshd.common.io.WritePendingException.class).when(asyncIn).write(any(Buffer.class));
+        doThrow(org.apache.sshd.common.io.WritePendingException.class).when(asyncIn).writePacket(any(Buffer.class));
         for (int i = 0; i < 1001; i++) {
             asyncSshHandler.write(ctx, Unpooled.copiedBuffer(new byte[]{0, 1, 2, 3, 4, 5}), secondWritePromise);
         }
@@ -490,10 +486,10 @@ public class AsyncSshHandlerTest {
         return subsystemChannel;
     }
 
-    private static IoOutputStream getMockedIoOutputStream() {
+    private static IoOutputStream getMockedIoOutputStream() throws IOException {
         final IoOutputStream mock = mock(IoOutputStream.class);
         final IoWriteFuture ioWriteFuture = mock(IoWriteFuture.class);
-        doReturn(ioWriteFuture).when(ioWriteFuture).addListener(Matchers.any());
+        doReturn(ioWriteFuture).when(ioWriteFuture).addListener(any());
         doReturn(true).when(ioWriteFuture).isWritten();
 
         Futures.addCallback(stubAddListener(ioWriteFuture), new SuccessFutureListener<IoWriteFuture>() {
@@ -503,7 +499,7 @@ public class AsyncSshHandlerTest {
             }
         }, MoreExecutors.directExecutor());
 
-        doReturn(ioWriteFuture).when(mock).write(any(Buffer.class));
+        doReturn(ioWriteFuture).when(mock).writePacket(any(Buffer.class));
         doReturn(false).when(mock).isClosed();
         doReturn(false).when(mock).isClosing();
         return mock;
@@ -513,10 +509,11 @@ public class AsyncSshHandlerTest {
         final IoInputStream mock = mock(IoInputStream.class);
         final IoReadFuture ioReadFuture = mock(IoReadFuture.class);
         doReturn(null).when(ioReadFuture).getException();
-        doReturn(ioReadFuture).when(ioReadFuture).removeListener(Matchers.any());
+        doReturn(ioReadFuture).when(ioReadFuture).removeListener(any());
+        doReturn(ioReadFuture).when(mock).read(any());
         doReturn(5).when(ioReadFuture).getRead();
         doReturn(new ByteArrayBuffer(new byte[]{0, 1, 2, 3, 4})).when(ioReadFuture).getBuffer();
-        doReturn(ioReadFuture).when(ioReadFuture).addListener(Matchers.any());
+        doReturn(ioReadFuture).when(ioReadFuture).addListener(any());
 
         // Always success for read
         Futures.addCallback(stubAddListener(ioReadFuture), new SuccessFutureListener<IoReadFuture>() {
index 2d60e0c4be95072f16f9bbb5def6fb076e81488c..f2c2eeb94a5560642b277c21db9f54b21a243e24 100644 (file)
@@ -58,8 +58,8 @@
             <artifactId>slf4j-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>xmlunit</groupId>
-            <artifactId>xmlunit</artifactId>
+            <groupId>org.xmlunit</groupId>
+            <artifactId>xmlunit-legacy</artifactId>
         </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
index ade7a3564810cdb45a19dfab2891a203c5b09258..c9ceabda4a55345a29dfa9ddcc4031075fcd4c85 100644 (file)
@@ -5,10 +5,8 @@
  * 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.notifications.impl.ops;
 
-import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Collections2;
 import com.google.common.collect.Iterables;
@@ -16,6 +14,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.Date;
+import java.util.Optional;
 import javassist.ClassPool;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.transform.dom.DOMResult;
@@ -33,22 +32,14 @@ import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 
 public final class NotificationsTransformUtil {
-
-    private static final Logger LOG = LoggerFactory.getLogger(NotificationsTransformUtil.class);
-
-    private NotificationsTransformUtil() {}
-
     static final SchemaContext NOTIFICATIONS_SCHEMA_CTX;
     static final BindingNormalizedNodeCodecRegistry CODEC_REGISTRY;
     static final RpcDefinition CREATE_SUBSCRIPTION_RPC;
 
     static {
-
         final ModuleInfoBackedContext moduleInfoBackedContext = ModuleInfoBackedContext.create();
         moduleInfoBackedContext.addModuleInfos(Collections.singletonList($YangModuleInfoImpl.getInstance()));
         moduleInfoBackedContext.addModuleInfos(Collections.singletonList(org.opendaylight.yang.gen.v1.urn.ietf.params
@@ -67,6 +58,10 @@ public final class NotificationsTransformUtil {
                 NOTIFICATIONS_SCHEMA_CTX));
     }
 
+    private NotificationsTransformUtil() {
+
+    }
+
     @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "Unrecognised NullableDecl")
     private static RpcDefinition findCreateSubscriptionRpc() {
         return Iterables.getFirst(Collections2.filter(NOTIFICATIONS_SCHEMA_CTX.getOperations(),
@@ -76,17 +71,17 @@ public final class NotificationsTransformUtil {
     /**
      * Transform base notification for capabilities into NetconfNotification.
      */
-    public static NetconfNotification transform(final Notification notification, SchemaPath path) {
-        return transform(notification, Optional.absent(), path);
+    public static NetconfNotification transform(final Notification notification, final SchemaPath path) {
+        return transform(notification, Optional.empty(), path);
     }
 
-    public static NetconfNotification transform(final Notification notification,
-                                                final Date eventTime, SchemaPath path) {
-        return transform(notification, Optional.fromNullable(eventTime), path);
+    public static NetconfNotification transform(final Notification notification, final Date eventTime,
+            final SchemaPath path) {
+        return transform(notification, Optional.ofNullable(eventTime), path);
     }
 
-    private static NetconfNotification transform(final Notification notification,
-                                                 final Optional<Date> eventTime, SchemaPath path) {
+    private static NetconfNotification transform(final Notification notification, final Optional<Date> eventTime,
+            final SchemaPath path) {
         final ContainerNode containerNode = CODEC_REGISTRY.toNormalizedNodeNotification(notification);
         final DOMResult result = new DOMResult(XmlUtil.newDocument());
         try {
index 5b7423a7565545872211bb7e93b8483b7968f45e..49b1c04ce1cbc9a59abbab5ffa0659bf0bf27fb4 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.14.0-SNAPSHOT</version>
+    <version>3.0.1</version>
     <relativePath/>
   </parent>
 
index 0fff7204235e1b44ba7620534aad27e12ab92c5a..4fdaafe6c2a97cd8a8a572591f4245bba425298f 100644 (file)
@@ -40,8 +40,8 @@
     </dependency>
 
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-inet-types-2013-07-15</artifactId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+      <artifactId>rfc6991-ietf-inet-types</artifactId>
     </dependency>
     <dependency>
       <groupId>com.google.guava</groupId>
index 733d81af1ffc11b7676767ad07e6cade8a1ecc9f..36313786b16b82552822c193d5b3ed9a06609375 100644 (file)
@@ -5,7 +5,6 @@
  * 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.ssh;
 
 import com.google.common.base.Preconditions;
@@ -23,11 +22,11 @@ import java.net.SocketAddress;
 import org.apache.sshd.common.NamedFactory;
 import org.apache.sshd.common.io.IoInputStream;
 import org.apache.sshd.common.io.IoOutputStream;
-import org.apache.sshd.server.AsyncCommand;
-import org.apache.sshd.server.Command;
 import org.apache.sshd.server.Environment;
 import org.apache.sshd.server.ExitCallback;
 import org.apache.sshd.server.SessionAware;
+import org.apache.sshd.server.command.AsyncCommand;
+import org.apache.sshd.server.command.Command;
 import org.apache.sshd.server.session.ServerSession;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.slf4j.Logger;
index ed04cc141e551ed2e1f69934b8398bb4cfe47716..5248951b13066f49b426d7d7313644ca518f2177 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>bundle-parent</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 17ea6cf2437ab43389beacf2e4fd018c5b4eeb57..8056ad79d3c56a5888b21ea79e59d178b96d8801 100644 (file)
@@ -13,6 +13,7 @@ import akka.actor.ActorSystem;
 import akka.dispatch.OnComplete;
 import akka.pattern.Patterns;
 import akka.util.Timeout;
+import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.SettableFuture;
@@ -48,7 +49,7 @@ public class ProxyDOMRpcService implements DOMRpcService {
     private final ExceptionMapper<DOMRpcException> domRpcExceptionMapper =
         new ExceptionMapper<DOMRpcException>("invokeRpc", DOMRpcException.class) {
             @Override
-            protected DOMRpcException newWithCause(String message, Throwable cause) {
+            protected DOMRpcException newWithCause(final String message, final Throwable cause) {
                 return new ClusteringRpcException(id + ": Exception during remote rpc invocation.", cause);
             }
         };
@@ -92,12 +93,12 @@ public class ProxyDOMRpcService implements DOMRpcService {
                     return;
                 }
 
-                final Collection<RpcError> errors = ((InvokeRpcMessageReply) response).getRpcErrors();
+                final Collection<? extends RpcError> errors = ((InvokeRpcMessageReply) response).getRpcErrors();
                 final NormalizedNodeMessage normalizedNodeMessageResult =
                         ((InvokeRpcMessageReply) response).getNormalizedNodeMessage();
                 final DOMRpcResult result;
                 if (normalizedNodeMessageResult == null) {
-                    result = new DefaultDOMRpcResult(errors);
+                    result = new DefaultDOMRpcResult(ImmutableList.copyOf(errors));
                 } else {
                     result = new DefaultDOMRpcResult(normalizedNodeMessageResult.getNode(), errors);
                 }
index 2f05f006a4aa00e0ab9cad073015d6a78399f297..e43ab4030dd4ddb99829ff3e85e18ceaf1ed6b1c 100644 (file)
@@ -26,11 +26,11 @@ public class InvokeRpcMessageReply implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @SuppressFBWarnings("SE_BAD_FIELD")
-    private final Collection<RpcError> rpcErrors;
+    private final Collection<? extends RpcError> rpcErrors;
     private final NormalizedNodeMessage normalizedNodeMessage;
 
     public InvokeRpcMessageReply(@Nullable final NormalizedNodeMessage normalizedNodeMessage,
-                                 @Nonnull final Collection<RpcError> rpcErrors) {
+                                 @Nonnull final Collection<? extends RpcError> rpcErrors) {
         this.normalizedNodeMessage = normalizedNodeMessage;
         this.rpcErrors = Objects.requireNonNull(rpcErrors);
     }
@@ -41,7 +41,7 @@ public class InvokeRpcMessageReply implements Serializable {
     }
 
     @Nonnull
-    public Collection<RpcError> getRpcErrors() {
+    public Collection<? extends RpcError> getRpcErrors() {
         return rpcErrors;
     }
 
@@ -64,7 +64,7 @@ public class InvokeRpcMessageReply implements Serializable {
         }
 
         @Override
-        public void writeExternal(ObjectOutput out) throws IOException {
+        public void writeExternal(final ObjectOutput out) throws IOException {
             out.writeInt(invokeRpcMessageReply.getRpcErrors().size());
             for (final RpcError rpcError : invokeRpcMessageReply.getRpcErrors()) {
                 out.writeObject(rpcError);
@@ -73,7 +73,7 @@ public class InvokeRpcMessageReply implements Serializable {
         }
 
         @Override
-        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
             final int size = in.readInt();
             final Collection<RpcError> rpcErrors = new LinkedList<>();
             for (int i = 0; i < size; i++) {
index c23046e86f72b2aad8cdb0453888c2ad609604d3..4fcf8aa0b6ea42ca6ac37327473e87de842b8ffb 100644 (file)
@@ -14,7 +14,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.never;
@@ -508,8 +508,8 @@ public class MountPointEndToEndTest {
         assertEquals(result.getResult(), actual.getResult());
 
         assertEquals(result.getErrors().size(), actual.getErrors().size());
-        Iterator<RpcError> iter1 = result.getErrors().iterator();
-        Iterator<RpcError> iter2 = actual.getErrors().iterator();
+        Iterator<? extends RpcError> iter1 = result.getErrors().iterator();
+        Iterator<? extends RpcError> iter2 = actual.getErrors().iterator();
         while (iter1.hasNext() && iter2.hasNext()) {
             RpcError err1 = iter1.next();
             RpcError err2 = iter2.next();
index 321f5817aacad67ea3db84a2dfec8a98d5596a5d..694853e6f78b00ce5cc359d3f71549437a7bafb7 100644 (file)
@@ -12,9 +12,9 @@ import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.argThat;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.argThat;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.after;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doNothing;
@@ -56,7 +56,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.mockito.ArgumentCaptor;
-import org.mockito.ArgumentMatcher;
 import org.mockito.Mock;
 import org.opendaylight.controller.cluster.schema.provider.impl.YangTextSchemaSourceSerializationProxy;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
@@ -543,7 +542,7 @@ public class NetconfNodeActorTest {
         return slaveRef;
     }
 
-    private void initializeMaster(List<SourceIdentifier> sourceIdentifiers) {
+    private void initializeMaster(final List<SourceIdentifier> sourceIdentifiers) {
         masterRef.tell(new CreateInitialMasterActorData(mockDOMDataBroker, sourceIdentifiers,
                 mockDOMRpcService), testKit.getRef());
 
@@ -561,13 +560,7 @@ public class NetconfNodeActorTest {
     }
 
     private static PotentialSchemaSource<?> withSourceId(final SourceIdentifier identifier) {
-        return argThat(new ArgumentMatcher<PotentialSchemaSource<?>>() {
-            @Override
-            public boolean matches(final Object argument) {
-                final PotentialSchemaSource<?> potentialSchemaSource = (PotentialSchemaSource<?>) argument;
-                return identifier.equals(potentialSchemaSource.getSourceIdentifier());
-            }
-        });
+        return argThat(argument -> identifier.equals(argument.getSourceIdentifier()));
     }
 
     private static String convertStreamToString(final InputStream is) {
index ca7b766323fb42bcca6dfd1cf232dd2aabd7067d..c61d1f8e93961c7511990a873079aa12028a1a8b 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.netconf.topology.singleton.impl;
 
 import static org.awaitility.Awaitility.await;
 import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
@@ -192,7 +192,7 @@ public class NetconfTopologyManagerTest {
         final DataObjectModification<Node> dataObjectModification1 = mock(DataObjectModification.class);
         doReturn(WRITE).when(dataObjectModification1).getModificationType();
         doReturn(node1).when(dataObjectModification1).getDataAfter();
-        doReturn(new InstanceIdentifier.IdentifiableItem<>(Node.class, new NodeKey(nodeId1)))
+        doReturn(InstanceIdentifier.IdentifiableItem.of(Node.class, new NodeKey(nodeId1)))
                 .when(dataObjectModification1).getIdentifier();
 
         final NetconfNode netconfNode2 = new NetconfNodeBuilder()
@@ -206,7 +206,7 @@ public class NetconfTopologyManagerTest {
         final DataObjectModification<Node> dataObjectModification2 = mock(DataObjectModification.class);
         doReturn(WRITE).when(dataObjectModification2).getModificationType();
         doReturn(node2).when(dataObjectModification2).getDataAfter();
-        doReturn(new InstanceIdentifier.IdentifiableItem<>(Node.class, new NodeKey(nodeId2)))
+        doReturn(InstanceIdentifier.IdentifiableItem.of(Node.class, new NodeKey(nodeId2)))
                 .when(dataObjectModification2).getIdentifier();
 
         final NetconfTopologyContext mockContext1 = mock(NetconfTopologyContext.class);
@@ -349,7 +349,7 @@ public class NetconfTopologyManagerTest {
         final DataObjectModification<Node> dataObjectModification = mock(DataObjectModification.class);
         doReturn(WRITE).when(dataObjectModification).getModificationType();
         doReturn(node).when(dataObjectModification).getDataAfter();
-        doReturn(new InstanceIdentifier.IdentifiableItem<>(Node.class, new NodeKey(nodeId)))
+        doReturn(InstanceIdentifier.IdentifiableItem.of(Node.class, new NodeKey(nodeId)))
                 .when(dataObjectModification).getIdentifier();
 
         final NetconfTopologyContext mockContext = mock(NetconfTopologyContext.class);
index e41d2f3f0a62186eac052cf8154454d74ed7b943..3b697f4bb51d79d8b528e5aacc55447d875c5501 100644 (file)
@@ -45,8 +45,8 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>xmlunit</groupId>
-      <artifactId>xmlunit</artifactId>
+      <groupId>org.xmlunit</groupId>
+      <artifactId>xmlunit-legacy</artifactId>
       <scope>test</scope>
     </dependency>
    <dependency>
index 4c170c7d9e3d7e83f551fb65d4920d9fdaeaf977..e4f4fb379e4067d3adef5ad62a12a8d9f85a1baf 100644 (file)
@@ -13,7 +13,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
index 9a49ee1fa6547a393e3df5d3178570bcdab6d9d8..f285c84f486a6577a6e486f024aadfdddbba98de 100644 (file)
@@ -40,7 +40,7 @@
       <artifactId>ietf-netconf-notifications</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
       <artifactId>rfc7895</artifactId>
     </dependency>
     <dependency>
@@ -92,8 +92,8 @@
       <artifactId>yang-data-codec-xml</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-inet-types-2013-07-15</artifactId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+      <artifactId>rfc6991-ietf-inet-types</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>xmlunit</groupId>
-      <artifactId>xmlunit</artifactId>
+      <groupId>org.xmlunit</groupId>
+      <artifactId>xmlunit-legacy</artifactId>
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
index 2eb98bb3051908a8eaf993f6feeb4afcf435995f..0d880f2dc5b794f4dd7a2fd781fe00a4cafc0a7c 100644 (file)
@@ -27,6 +27,7 @@ import org.opendaylight.netconf.api.NetconfMessage;
 import org.opendaylight.netconf.sal.connect.api.MessageTransformer;
 import org.opendaylight.netconf.sal.connect.api.RemoteDeviceCommunicator;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.NoOpListenerRegistration;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
@@ -77,25 +78,7 @@ public final class NetconfDeviceRpc implements DOMRpcService {
         listener.onRpcAvailable(Collections2.transform(schemaContext.getOperations(),
             input -> DOMRpcIdentifier.create(input.getPath())));
 
-        return new NoOpListenerRegistration<>(listener);
-    }
-
-    private static final class NoOpListenerRegistration<T extends DOMRpcAvailabilityListener>
-            implements ListenerRegistration<T> {
-        private final T listener;
-
-        NoOpListenerRegistration(final T listener) {
-            this.listener = requireNonNull(listener);
-        }
-
-        @Override
-        public T getInstance() {
-            return listener;
-        }
-
-        @Override
-        public void close() {
-            // NOOP, no rpcs appear and disappear in this implementation
-        }
+        // NOOP, no rpcs appear and disappear in this implementation
+        return NoOpListenerRegistration.of(listener);
     }
 }
index a7e0de26dbd283ee8b2e429e1e8c4df493f9c9d1..47e38a7a2d20021e6064e401a201d028a5e2418b 100644 (file)
@@ -8,9 +8,10 @@
 package org.opendaylight.netconf.sal.connect.netconf;
 
 import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyCollectionOf;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyCollectionOf;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.after;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doNothing;
@@ -161,8 +162,7 @@ public class NetconfDeviceTest {
         device.onRemoteSessionUp(sessionCaps, listener);
 
         Mockito.verify(facade, Mockito.timeout(5000)).onDeviceConnected(
-                any(SchemaContext.class), any(NetconfSessionPreferences.class), any(NetconfDeviceRpc.class),
-                any(DOMActionService.class));
+                any(SchemaContext.class), any(NetconfSessionPreferences.class), any(NetconfDeviceRpc.class), isNull());
         Mockito.verify(schemaFactory, times(2)).createSchemaContext(anyCollectionOf(SourceIdentifier.class));
     }
 
@@ -249,8 +249,7 @@ public class NetconfDeviceTest {
         device.onRemoteSessionUp(sessionCaps, listener);
 
         Mockito.verify(facade, Mockito.timeout(5000)).onDeviceConnected(
-                any(SchemaContext.class), any(NetconfSessionPreferences.class), any(NetconfDeviceRpc.class),
-                any(DOMActionService.class));
+                any(SchemaContext.class), any(NetconfSessionPreferences.class), any(NetconfDeviceRpc.class), isNull());
         Mockito.verify(schemaFactory, times(1)).createSchemaContext(anyCollectionOf(SourceIdentifier.class));
     }
 
@@ -329,7 +328,7 @@ public class NetconfDeviceTest {
         verify(schemaContextProviderFactory, timeout(5000)).createSchemaContext(any(Collection.class));
         verify(facade, timeout(5000)).onDeviceConnected(
                 any(SchemaContext.class), any(NetconfSessionPreferences.class), any(DOMRpcService.class),
-                any(DOMActionService.class));
+                isNull());
 
         device.onRemoteSessionDown();
         verify(facade, timeout(5000)).onDeviceDisconnected();
@@ -339,7 +338,7 @@ public class NetconfDeviceTest {
         verify(schemaContextProviderFactory, timeout(5000).times(2)).createSchemaContext(any(Collection.class));
         verify(facade, timeout(5000).times(2)).onDeviceConnected(
                 any(SchemaContext.class), any(NetconfSessionPreferences.class), any(DOMRpcService.class),
-                any(DOMActionService.class));
+                isNull());
     }
 
     @Test
@@ -402,8 +401,7 @@ public class NetconfDeviceTest {
         final ArgumentCaptor<NetconfSessionPreferences> argument =
                 ArgumentCaptor.forClass(NetconfSessionPreferences.class);
         verify(facade, timeout(5000))
-                .onDeviceConnected(any(SchemaContext.class), argument.capture(), any(DOMRpcService.class),
-                        any(DOMActionService.class));
+                .onDeviceConnected(any(SchemaContext.class), argument.capture(), any(DOMRpcService.class), isNull());
         final NetconfDeviceCapabilities netconfDeviceCaps = argument.getValue().getNetconfDeviceCapabilities();
 
         netconfDeviceCaps.getResolvedCapabilities()
index 07bed0593d53b5e9059eae8897a7d7a71cd8ef75..3466294510c5b697629e4069934ad152fe4c0fe6 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.netconf.sal.connect.netconf;
 
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
@@ -59,7 +60,7 @@ public class SchemalessNetconfDeviceTest {
                 any(SchemaContext.class), any(NetconfSessionPreferences.class), any(DOMRpcService.class));
 
         device.onNotification(netconfMessage);
-        verify(facade).onNotification(any(DOMNotification.class));
+        verify(facade).onNotification(isNull());
 
         device.onRemoteSessionDown();
         verify(facade).onDeviceDisconnected();
index 30a67cb79c4e0b07334cefb7f41cfa4f39d3c5fd..1c9142352118f4a8b2e46286d101801f91daa3d6 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.netconf.sal.connect.netconf.sal;
 
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
@@ -102,13 +103,16 @@ public class KeepaliveSalFacadeTest {
         final DOMRpcResult result = new DefaultDOMRpcResult(Builders.containerBuilder().withNodeIdentifier(
                 new YangInstanceIdentifier.NodeIdentifier(NetconfMessageTransformUtil.NETCONF_RUNNING_QNAME)).build());
 
+        doReturn(Futures.immediateCheckedFuture(result))
+                .when(deviceRpc).invokeRpc(any(SchemaPath.class), isNull());
+
         doReturn(Futures.immediateCheckedFuture(result))
                 .when(deviceRpc).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
 
         keepaliveSalFacade.onDeviceConnected(null, null, deviceRpc);
 
         verify(underlyingSalFacade).onDeviceConnected(
-                any(SchemaContext.class), any(NetconfSessionPreferences.class), any(DOMRpcService.class), any());
+                isNull(), isNull(), any(DOMRpcService.class), isNull());
 
         verify(deviceRpc, timeout(15000).times(5)).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
     }
@@ -121,8 +125,7 @@ public class KeepaliveSalFacadeTest {
 
         keepaliveSalFacade.onDeviceConnected(null, null, deviceRpc);
 
-        verify(underlyingSalFacade).onDeviceConnected(
-                any(SchemaContext.class), any(NetconfSessionPreferences.class), any(DOMRpcService.class), any());
+        verify(underlyingSalFacade).onDeviceConnected(isNull(), isNull(), any(DOMRpcService.class), isNull());
 
         // Should disconnect the session
         verify(listener, timeout(15000).times(1)).disconnect();
@@ -139,8 +142,8 @@ public class KeepaliveSalFacadeTest {
 
         keepaliveSalFacade.onDeviceConnected(null, null, deviceRpc);
 
-        verify(underlyingSalFacade).onDeviceConnected(
-                any(SchemaContext.class), any(NetconfSessionPreferences.class), any(DOMRpcService.class), any());
+        verify(underlyingSalFacade).onDeviceConnected(isNull(), isNull(), any(DOMRpcService.class), isNull());
+
 
         // Shouldn't disconnect the session
         verify(listener, times(0)).disconnect();
@@ -153,8 +156,7 @@ public class KeepaliveSalFacadeTest {
             invocationOnMock -> {
                 proxyRpc = (DOMRpcService) invocationOnMock.getArguments()[2];
                 return null;
-            }).when(underlyingSalFacade).onDeviceConnected(
-                any(SchemaContext.class), any(NetconfSessionPreferences.class), any(DOMRpcService.class), any());
+            }).when(underlyingSalFacade).onDeviceConnected(isNull(), isNull(), any(DOMRpcService.class), isNull());
 
         doReturn(Futures.immediateFailedCheckedFuture(new IllegalStateException("illegal-state")))
                 .when(deviceRpc).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
index c96a6741d16a079839597e90cbff0e88b780c7fd..d93e24e158de272c6cc7675f2188493c889ea8a0 100644 (file)
@@ -8,8 +8,9 @@
 
 package org.opendaylight.netconf.sal.connect.netconf.sal;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
@@ -23,7 +24,6 @@ import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.dom.api.DOMActionService;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.controller.md.sal.dom.api.DOMNotification;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
@@ -97,7 +97,7 @@ public class NetconfDeviceSalFacadeTest {
 
         verify(mountInstance, times(1)).onTopologyDeviceConnected(eq(schemaContext),
                 any(DOMDataBroker.class), eq(deviceRpc), any(NetconfDeviceNotificationService.class),
-                any(DOMActionService.class));
+                isNull());
         verify(netconfDeviceTopologyAdapter,
                 times(1)).updateDeviceData(true, netconfSessionPreferences.getNetconfDeviceCapabilities());
     }
index 91879669b3357b2549ffd708933d2e0c88a00dc8..7461a1484902438ae92da498d495084ceb595840 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.netconf.sal.connect.netconf.sal;
 
 import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
@@ -116,7 +116,7 @@ public class NetconfDeviceTopologyAdapterTest {
 
         verify(txChain, times(2)).newWriteOnlyTransaction();
         verify(writeTx, times(1))
-                .put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(NetconfNode.class));
+                .put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class));
         adapter.close();
 
         adapter = new NetconfDeviceTopologyAdapter(id, transactionChain); //not a mock
@@ -140,7 +140,7 @@ public class NetconfDeviceTopologyAdapterTest {
 
         verify(txChain, times(2)).newWriteOnlyTransaction();
         verify(writeTx, times(1))
-                .put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(NetconfNode.class));
+                .put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class));
         verify(writeTx, times(1)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class));
 
     }
index 583ab79b6e519a832d68105ff038edd523246964..95e177a1f126a540c5528e065495a35f627cb81d 100644 (file)
@@ -9,8 +9,9 @@
 package org.opendaylight.netconf.sal.connect.netconf.sal.tx;
 
 import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.atMost;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.inOrder;
@@ -88,6 +89,9 @@ public class NetconfDeviceWriteOnlyTxTest {
 
     @Test
     public void testDiscardChanges() throws InterruptedException {
+        doReturn(Futures.immediateCheckedFuture(new DefaultDOMRpcResult((NormalizedNode<?, ?>) null)))
+                .when(rpc).invokeRpc(any(SchemaPath.class), isNull());
+
         final WriteCandidateTx tx = new WriteCandidateTx(id, new NetconfBaseOps(rpc, mock(SchemaContext.class)),
                 false);
         try {
@@ -100,7 +104,7 @@ public class NetconfDeviceWriteOnlyTxTest {
             inOrder.verify(rpc).invokeRpc(toPath(NetconfMessageTransformUtil.NETCONF_COMMIT_QNAME),
                     NetconfMessageTransformUtil.COMMIT_RPC_CONTENT);
             inOrder.verify(rpc).invokeRpc(eq(toPath(NetconfMessageTransformUtil.NETCONF_DISCARD_CHANGES_QNAME)),
-                    any(NormalizedNode.class));
+                    isNull());
             inOrder.verify(rpc).invokeRpc(toPath(NetconfMessageTransformUtil.NETCONF_UNLOCK_QNAME),
                     NetconfBaseOps.getUnLockContent(NETCONF_CANDIDATE_QNAME));
             return;
@@ -168,7 +172,7 @@ public class NetconfDeviceWriteOnlyTxTest {
     @Test
     public void testListenerCancellation() throws Exception {
         doReturn(Futures.immediateCheckedFuture(new DefaultDOMRpcResult((NormalizedNode<?, ?>) null)))
-                .when(rpc).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
+                .when(rpc).invokeRpc(any(SchemaPath.class), isNull());
         final WriteCandidateTx tx = new WriteCandidateTx(
                 id, new NetconfBaseOps(rpc, BaseSchema.BASE_NETCONF_CTX.getSchemaContext()), false);
         final TxListener listener = mock(TxListener.class);
index 4ece5f4ae313530e430d2726456a5efcebe8d3bb..47e12ca6087eca75489a01b9991bebfe21074f7c 100644 (file)
@@ -8,9 +8,9 @@
 
 package org.opendaylight.netconf.sal.connect.netconf.util;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.argThat;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.argThat;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -22,11 +22,10 @@ import java.util.ArrayList;
 import java.util.List;
 import org.custommonkey.xmlunit.Diff;
 import org.custommonkey.xmlunit.XMLUnit;
-import org.hamcrest.BaseMatcher;
-import org.hamcrest.Description;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.ArgumentMatcher;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
@@ -268,7 +267,7 @@ public class NetconfBaseOpsTest {
         }
     }
 
-    private static class NetconfMessageMatcher extends BaseMatcher<NetconfMessage> {
+    private static class NetconfMessageMatcher implements ArgumentMatcher<NetconfMessage> {
 
         private final Document expected;
 
@@ -277,11 +276,7 @@ public class NetconfBaseOpsTest {
         }
 
         @Override
-        public boolean matches(final Object item) {
-            if (!(item instanceof NetconfMessage)) {
-                return false;
-            }
-            final NetconfMessage message = (NetconfMessage) item;
+        public boolean matches(final NetconfMessage message) {
             final Document actualDoc = removeAttrs(message.getDocument());
             actualDoc.normalizeDocument();
             expected.normalizeDocument();
@@ -289,11 +284,6 @@ public class NetconfBaseOpsTest {
             return diff.similar();
         }
 
-        @Override
-        public void describeTo(final Description description) {
-            description.appendText(XmlUtil.toString(expected));
-        }
-
         private static Document removeAttrs(final Document input) {
             final Document copy = XmlUtil.newDocument();
             copy.appendChild(copy.importNode(input.getDocumentElement(), true));
index 785fc6343972f642750c8504ed5c8d766e6c5e35..9b659c328a4b990daf1b0226760db854c95c51c5 100644 (file)
             <artifactId>netconf-client</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-yang-types-20130715</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-inet-types-2013-07-15</artifactId>
+            <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+            <artifactId>rfc6991</artifactId>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
index a96b375e339d5ed1eba0aac48e9daf32520ebd1b..85e438e0dceb31eb07d48e1889c539f72a4ff88d 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
index f3288dc3e9a98c9c56fabcd66e73d5bf6e629453..4daffcdf45ab649bef480a52b0a7b6e8e71729a7 100644 (file)
@@ -47,7 +47,7 @@
             <artifactId>guava</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
+            <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
             <artifactId>rfc7895</artifactId>
         </dependency>
         <dependency>
diff --git a/pom.xml b/pom.xml
index 13a0be6d76fd9bac14920f52dcb20a0f9e95a183..591144c3c2e3ae147538fd7785a0acf235547dac 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index d66078b4ba5d25a2f95cbca482e9481475bc197c..741e57ffe49e962ce49b6a0aeaf0a5b7b09a00eb 100644 (file)
@@ -7,7 +7,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>bundle-parent</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
@@ -48,7 +48,7 @@
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>mockito-configuration</artifactId>
-      <version>2.0.10</version>
+      <version>2.1.2</version>
       <scope>test</scope>
     </dependency>
     <dependency>
index 919bad178b5447c7ff81212258d2d0c9fb5310be..c2f1fe2f2425f0efac2d74070a956f6d179839d0 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>3.1.3</version>
+        <version>4.0.2</version>
         <relativePath/>
     </parent>
 
index 2bbac4757638bd8a2e4d806eb4908e6aff40af2a..d4e76d1f10f02100d9376b87616d6bd62f205d2b 100644 (file)
@@ -13,7 +13,7 @@
     <parent>
       <groupId>org.opendaylight.odlparent</groupId>
       <artifactId>odlparent-lite</artifactId>
-      <version>3.1.3</version>
+      <version>4.0.2</version>
       <relativePath/>
     </parent>
 
index 3f1f458fb31540fca75217b6c699ddd43a93fa63..0d1868e03d3c9a933b9895e21527f0c103e4d1d0 100644 (file)
@@ -139,7 +139,7 @@ public class RestconfDocumentedException extends WebApplicationException {
      * Constructs an instance with the given RpcErrors.
      */
     public RestconfDocumentedException(final String message, final Throwable cause,
-                                       final Collection<RpcError> rpcErrors) {
+                                       final Collection<? extends RpcError> rpcErrors) {
         this(message, cause, convertToRestconfErrors(rpcErrors));
     }
 
@@ -162,7 +162,7 @@ public class RestconfDocumentedException extends WebApplicationException {
         status = null;
     }
 
-    private static List<RestconfError> convertToRestconfErrors(final Collection<RpcError> rpcErrors) {
+    private static List<RestconfError> convertToRestconfErrors(final Collection<? extends RpcError> rpcErrors) {
         final List<RestconfError> errorList = Lists.newArrayList();
         if (rpcErrors != null) {
             for (RpcError rpcError : rpcErrors) {
index 7f0bdf2ace1af3d97d50e2b9b83793319c3221a9..04208799328584ff8db732bb0ec0f7b07de3bb1b 100644 (file)
 
     <dependencies>
         <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-inet-types-2013-07-15</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-yang-types-20130715</artifactId>
+            <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+            <artifactId>rfc6991</artifactId>
         </dependency>
     </dependencies>
 </project>
index 6cb9892c990620b913ecae058cfc83c93c83090a..2d50442a05463f8eb0ac1cae699911ebcd4996fb 100644 (file)
 
     <dependencies>
         <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-inet-types-2013-07-15</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>ietf-yang-types-20130715</artifactId>
+            <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+            <artifactId>rfc6991</artifactId>
         </dependency>
     </dependencies>
 </project>
index 8407178fbacce3af8a66c98e8582bdca9215347d..55ae9bb364a7f4e36550f25a7a706a15292c09ce 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
index ff5c2e3b4aed5a5a431be6a513727b253e617fe2..5a0eb09af4322a88c6fb7955803587ebce86b6c1 100644 (file)
@@ -32,7 +32,6 @@
     <dependency>
       <groupId>org.glassfish.jersey.bundles.repackaged</groupId>
       <artifactId>jersey-guava</artifactId>
-      <version>2.6</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <artifactId>ietf-restconf</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-yang-types-20130715</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-inet-types-2013-07-15</artifactId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+      <artifactId>rfc6991</artifactId>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>yang-model-export</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
       <artifactId>rfc7895</artifactId>
     </dependency>
     <dependency>
index 8ef05653dafcf74da73925cc44c68b36dc3182aa..f5eb340cf49320b22052b5345475b1ff6c1b6f44 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.controller.md.sal.rest.common;
 
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 
@@ -66,17 +66,16 @@ public final class TestRestconfUtils {
     }
 
     public static ControllerContext newControllerContext(SchemaContext schemaContext, DOMMountPoint mountInstance) {
+        final DOMMountPointService mockMountService = mock(DOMMountPointService.class);
+
         if (mountInstance != null) {
             doReturn(schemaContext).when(mountInstance).getSchemaContext();
+            doReturn(Optional.fromNullable(mountInstance)).when(mockMountService)
+                    .getMountPoint(any(YangInstanceIdentifier.class));
         }
 
-        final DOMMountPointService mockMountService = mock(DOMMountPointService.class);
-        doReturn(Optional.fromNullable(mountInstance)).when(mockMountService)
-            .getMountPoint(any(YangInstanceIdentifier.class));
-
         DOMSchemaService mockSchemaService = mock(DOMSchemaService.class);
         doReturn(schemaContext).when(mockSchemaService).getGlobalContext();
-        doReturn(ImmutableClassToInstanceMap.of()).when(mockSchemaService).getExtensions();
 
         DOMSchemaService mockDomSchemaService = mock(DOMSchemaService.class);
         doReturn(ImmutableClassToInstanceMap.of()).when(mockDomSchemaService).getExtensions();
index 8bbfae93426b712c1864cc2f092e01f2e658ece8..1053e73d63e0538e805d56b36e199179364bfcff 100644 (file)
@@ -13,8 +13,9 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -164,7 +165,7 @@ public class InvokeRpcMethodTest {
         final QName qname = QName.create("(http://netconfcentral.org/ns/toaster?revision=2009-11-20)cancel-toast");
         final SchemaPath type = SchemaPath.create(true, qname);
 
-        when(brokerFacade.invokeRpc(eq(type), any(NormalizedNode.class))).thenReturn(future);
+        when(brokerFacade.invokeRpc(eq(type), isNull())).thenReturn(future);
 
         try {
             this.restconfImpl.invokeRpc("toaster:cancel-toast", "", uriInfo);
@@ -211,7 +212,7 @@ public class InvokeRpcMethodTest {
         final SchemaPath path = SchemaPath.create(true,
                 QName.create("(http://netconfcentral.org/ns/toaster?revision=2009-11-20)cancel-toast"));
 
-        when(brokerFacade.invokeRpc(eq(path), any(NormalizedNode.class))).thenReturn(future);
+        when(brokerFacade.invokeRpc(eq(path), isNull())).thenReturn(future);
 
         try {
             this.restconfImpl.invokeRpc("toaster:cancel-toast", "", uriInfo);
@@ -233,7 +234,7 @@ public class InvokeRpcMethodTest {
         final QName qname = QName.create("(http://netconfcentral.org/ns/toaster?revision=2009-11-20)cancel-toast");
         final SchemaPath path = SchemaPath.create(true, qname);
 
-        when(brokerFacade.invokeRpc(eq(path), any(NormalizedNode.class))).thenReturn(future);
+        when(brokerFacade.invokeRpc(eq(path), isNull())).thenReturn(future);
 
         final NormalizedNodeContext output = this.restconfImpl.invokeRpc("toaster:cancel-toast", "", uriInfo);
         assertNotNull(output);
@@ -352,7 +353,7 @@ public class InvokeRpcMethodTest {
         final DOMRpcResult result = new DefaultDOMRpcResult(container);
         final CheckedFuture<DOMRpcResult, DOMRpcException> future = Futures.immediateCheckedFuture(result);
 
-        when(brokerFacade.invokeRpc(eq(rpcDef.getPath()), any(NormalizedNode.class))).thenReturn(future);
+        when(brokerFacade.invokeRpc(eq(rpcDef.getPath()), isNull())).thenReturn(future);
 
         final NormalizedNodeContext output = this.restconfImpl.invokeRpc("toaster:testOutput", "", uriInfo);
         assertNotNull(output);
index 5f452874414db85939709363fe333a3d3ee19268..df815ad1d27f83efbe1f8927c83346958c9239c7 100644 (file)
@@ -12,11 +12,11 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Matchers.isNull;
-import static org.mockito.Matchers.notNull;
-import static org.mockito.Matchers.same;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
+import static org.mockito.ArgumentMatchers.notNull;
+import static org.mockito.ArgumentMatchers.same;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
@@ -137,8 +137,8 @@ public class JSONRestconfServiceImplTest {
     public void testPut() throws Exception {
         final PutResult result = mock(PutResult.class);
         when(brokerFacade.commitConfigurationDataPut(notNull(SchemaContext.class),
-                notNull(YangInstanceIdentifier.class), notNull(NormalizedNode.class), Mockito.anyString(),
-                Mockito.anyString())).thenReturn(result);
+                notNull(YangInstanceIdentifier.class), notNull(NormalizedNode.class), isNull(), isNull()))
+                .thenReturn(result);
         when(result.getFutureOfPutData())
                 .thenReturn(Futures.immediateCheckedFuture(null));
         when(result.getStatus()).thenReturn(Status.OK);
@@ -150,7 +150,7 @@ public class JSONRestconfServiceImplTest {
                 ArgumentCaptor.forClass(YangInstanceIdentifier.class);
         final ArgumentCaptor<NormalizedNode> capturedNode = ArgumentCaptor.forClass(NormalizedNode.class);
         verify(brokerFacade).commitConfigurationDataPut(notNull(SchemaContext.class), capturedPath.capture(),
-                capturedNode.capture(), Mockito.anyString(), Mockito.anyString());
+                capturedNode.capture(), isNull(), isNull());
 
         verifyPath(capturedPath.getValue(), INTERFACES_QNAME, INTERFACE_QNAME,
                 new Object[]{INTERFACE_QNAME, NAME_QNAME, "eth0"});
@@ -170,8 +170,8 @@ public class JSONRestconfServiceImplTest {
     public void testPutBehindMountPoint() throws Exception {
         final PutResult result = mock(PutResult.class);
         when(brokerFacade.commitMountPointDataPut(notNull(DOMMountPoint.class),
-                notNull(YangInstanceIdentifier.class), notNull(NormalizedNode.class), Mockito.anyString(),
-                Mockito.anyString())).thenReturn(result);
+                notNull(YangInstanceIdentifier.class), notNull(NormalizedNode.class), isNull(), isNull()))
+                .thenReturn(result);
         when(result.getFutureOfPutData()).thenReturn(Futures.immediateCheckedFuture(null));
         when(result.getStatus()).thenReturn(Status.OK);
         final String uriPath = "ietf-interfaces:interfaces/yang-ext:mount/test-module:cont/cont1";
@@ -183,7 +183,7 @@ public class JSONRestconfServiceImplTest {
                 ArgumentCaptor.forClass(YangInstanceIdentifier.class);
         final ArgumentCaptor<NormalizedNode> capturedNode = ArgumentCaptor.forClass(NormalizedNode.class);
         verify(brokerFacade).commitMountPointDataPut(same(mockMountPoint), capturedPath.capture(),
-                capturedNode.capture(), Mockito.anyString(), Mockito.anyString());
+                capturedNode.capture(), isNull(), isNull());
 
         verifyPath(capturedPath.getValue(), TEST_CONT_QNAME, TEST_CONT1_QNAME);
 
@@ -217,7 +217,7 @@ public class JSONRestconfServiceImplTest {
     public void testPost() throws Exception {
         doReturn(Futures.immediateCheckedFuture(null)).when(brokerFacade).commitConfigurationDataPost(
                 any(SchemaContext.class), any(YangInstanceIdentifier.class), any(NormalizedNode.class),
-                Mockito.anyString(), Mockito.anyString());
+                isNull(), isNull());
 
         final String uriPath = null;
         final String payload = loadData("/parts/ietf-interfaces_interfaces_absolute_path.json");
@@ -228,7 +228,7 @@ public class JSONRestconfServiceImplTest {
                 ArgumentCaptor.forClass(YangInstanceIdentifier.class);
         final ArgumentCaptor<NormalizedNode> capturedNode = ArgumentCaptor.forClass(NormalizedNode.class);
         verify(brokerFacade).commitConfigurationDataPost(notNull(SchemaContext.class), capturedPath.capture(),
-                capturedNode.capture(), Mockito.anyString(), Mockito.anyString());
+                capturedNode.capture(), isNull(), isNull());
 
         verifyPath(capturedPath.getValue(), INTERFACES_QNAME);
 
@@ -258,7 +258,7 @@ public class JSONRestconfServiceImplTest {
     public void testPostBehindMountPoint() throws Exception {
         doReturn(Futures.immediateCheckedFuture(null)).when(brokerFacade).commitConfigurationDataPost(
                 notNull(DOMMountPoint.class), notNull(YangInstanceIdentifier.class), notNull(NormalizedNode.class),
-                Mockito.anyString(), Mockito.anyString());
+                isNull(), isNull());
 
         final String uriPath = "ietf-interfaces:interfaces/yang-ext:mount/test-module:cont";
         final String payload = loadData("/full-versions/testCont1Data.json");
@@ -269,7 +269,7 @@ public class JSONRestconfServiceImplTest {
                 ArgumentCaptor.forClass(YangInstanceIdentifier.class);
         final ArgumentCaptor<NormalizedNode> capturedNode = ArgumentCaptor.forClass(NormalizedNode.class);
         verify(brokerFacade).commitConfigurationDataPost(same(mockMountPoint), capturedPath.capture(),
-                capturedNode.capture(), Mockito.anyString(), Mockito.anyString());
+                capturedNode.capture(), isNull(), isNull());
 
         verifyPath(capturedPath.getValue(), TEST_CONT_QNAME, TEST_CONT1_QNAME);
 
@@ -285,7 +285,7 @@ public class JSONRestconfServiceImplTest {
     public void testPostFailure() throws Throwable {
         doReturn(Futures.immediateFailedCheckedFuture(new TransactionCommitFailedException("mock"))).when(brokerFacade)
                 .commitConfigurationDataPost(any(SchemaContext.class), any(YangInstanceIdentifier.class),
-                        any(NormalizedNode.class), Mockito.anyString(), Mockito.anyString());
+                        any(NormalizedNode.class), isNull(), isNull());
 
         final String uriPath = null;
         final String payload = loadData("/parts/ietf-interfaces_interfaces_absolute_path.json");
@@ -445,7 +445,7 @@ public class JSONRestconfServiceImplTest {
 
         final DOMRpcResult expResult = new DefaultDOMRpcResult((NormalizedNode<?, ?>)null);
         doReturn(Futures.immediateCheckedFuture(expResult)).when(brokerFacade).invokeRpc(any(SchemaPath.class),
-                any(NormalizedNode.class));
+                isNull());
 
         final String uriPath = "toaster:cancel-toast";
 
@@ -453,7 +453,7 @@ public class JSONRestconfServiceImplTest {
 
         assertEquals("Output present", false, output.isPresent());
 
-        verify(brokerFacade).invokeRpc(eq(path), isNull(NormalizedNode.class));
+        verify(brokerFacade).invokeRpc(eq(path), isNull());
     }
 
     @Test
@@ -465,7 +465,7 @@ public class JSONRestconfServiceImplTest {
                 .withChild(ImmutableNodes.leafNode(TEXT_OUT_QNAME, "foo")).build();
         final DOMRpcResult expResult = new DefaultDOMRpcResult(outputNode);
         doReturn(Futures.immediateCheckedFuture(expResult)).when(brokerFacade).invokeRpc(any(SchemaPath.class),
-                any(NormalizedNode.class));
+                isNull());
 
         final String uriPath = "toaster:testOutput";
 
@@ -475,7 +475,7 @@ public class JSONRestconfServiceImplTest {
         assertNotNull("Returned null response", output.get());
         assertThat("Missing \"textOut\"", output.get(), containsString("\"textOut\":\"foo\""));
 
-        verify(brokerFacade).invokeRpc(eq(path), isNull(NormalizedNode.class));
+        verify(brokerFacade).invokeRpc(eq(path), isNull());
     }
 
     @Test(expected = OperationFailedException.class)
@@ -499,7 +499,7 @@ public class JSONRestconfServiceImplTest {
 
         if (datastoreType == LogicalDatastoreType.CONFIGURATION) {
             doReturn(entryNode).when(brokerFacade).readConfigurationData(notNull(YangInstanceIdentifier.class),
-                    Mockito.anyString());
+                    isNull());
         } else {
             doReturn(entryNode).when(brokerFacade).readOperationalData(notNull(YangInstanceIdentifier.class));
         }
@@ -519,7 +519,7 @@ public class JSONRestconfServiceImplTest {
         final ArgumentCaptor<YangInstanceIdentifier> capturedPath =
                 ArgumentCaptor.forClass(YangInstanceIdentifier.class);
         if (datastoreType == LogicalDatastoreType.CONFIGURATION) {
-            verify(brokerFacade).readConfigurationData(capturedPath.capture(), Mockito.anyString());
+            verify(brokerFacade).readConfigurationData(capturedPath.capture(), isNull());
         } else {
             verify(brokerFacade).readOperationalData(capturedPath.capture());
         }
index d8b7c52962fcafd0f574f98041c6f65eb90c3256..3ee87784197abf6ca764266ccaac948c5a7f862d 100644 (file)
@@ -14,8 +14,9 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -40,7 +41,6 @@ import org.glassfish.jersey.test.JerseyTest;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
-import org.mockito.Mockito;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
 import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
 import org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader;
@@ -169,8 +169,7 @@ public class RestGetOperationTest extends JerseyTest {
     @Test
     public void getDataWithUrlMountPoint() throws Exception {
         when(brokerFacade.readConfigurationData(any(DOMMountPoint.class), any(YangInstanceIdentifier.class),
-                Mockito.anyString())).thenReturn(
-                prepareCnDataForMountPointTest(false));
+                isNull())).thenReturn(prepareCnDataForMountPointTest(false));
         when(mountInstance.getSchemaContext()).thenReturn(schemaContextTestModule);
 
         String uri = "/config/ietf-interfaces:interfaces/interface/0/yang-ext:mount/test-module:cont/cont1";
@@ -192,7 +191,7 @@ public class RestGetOperationTest extends JerseyTest {
     public void getDataWithSlashesBehindMountPoint() throws Exception {
         final YangInstanceIdentifier awaitedInstanceIdentifier = prepareInstanceIdentifierForList();
         when(brokerFacade.readConfigurationData(any(DOMMountPoint.class), eq(awaitedInstanceIdentifier),
-                Mockito.anyString())).thenReturn(prepareCnDataForSlashesBehindMountPointTest());
+                isNull())).thenReturn(prepareCnDataForSlashesBehindMountPointTest());
 
         when(mountInstance.getSchemaContext()).thenReturn(schemaContextTestModule);
 
@@ -222,8 +221,7 @@ public class RestGetOperationTest extends JerseyTest {
     @Test
     public void getDataMountPointIntoHighestElement() throws Exception {
         when(brokerFacade.readConfigurationData(any(DOMMountPoint.class), any(YangInstanceIdentifier.class),
-                Mockito.anyString())).thenReturn(
-                prepareCnDataForMountPointTest(true));
+                isNull())).thenReturn(prepareCnDataForMountPointTest(true));
 
         when(mountInstance.getSchemaContext()).thenReturn(schemaContextTestModule);
 
@@ -610,7 +608,7 @@ public class RestGetOperationTest extends JerseyTest {
 
     @SuppressWarnings("unchecked")
     private void mockReadConfigurationDataMethod() {
-        when(brokerFacade.readConfigurationData(any(YangInstanceIdentifier.class), Mockito.anyString()))
+        when(brokerFacade.readConfigurationData(any(YangInstanceIdentifier.class), isNull()))
                 .thenReturn(answerFromGet);
     }
 
index 0701636fff48ca5c4ebb516bf76879e27f3e4dd1..4f68adbdb44a2297d2f076f527319a6d0c099244 100644 (file)
@@ -8,7 +8,8 @@
 package org.opendaylight.controller.sal.restconf.impl.test;
 
 import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
@@ -31,7 +32,6 @@ import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
-import org.mockito.Mockito;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
 import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
 import org.opendaylight.netconf.sal.rest.api.Draft02;
@@ -151,7 +151,7 @@ public class RestPostOperationTest extends JerseyTest {
     @Test
     public void createConfigurationDataNullTest() throws UnsupportedEncodingException {
         when(brokerFacade.commitConfigurationDataPost(any(SchemaContext.class), any(YangInstanceIdentifier.class),
-                any(NormalizedNode.class), Mockito.anyString(), Mockito.anyString()))
+                any(NormalizedNode.class), isNull(), isNull()))
                 .thenReturn(Futures.immediateCheckedFuture(null));
 
         //FIXME : find who is set schemaContext
index 6067e419d7c09b4d9816911bf5c0c0441fb24317..59474e3991e734620d0452a0ff0a3cd981d86acf 100644 (file)
@@ -9,8 +9,9 @@ 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.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
@@ -53,7 +54,6 @@ import org.opendaylight.restconf.common.errors.RestconfError;
 import org.opendaylight.restconf.common.errors.RestconfError.ErrorTag;
 import org.opendaylight.restconf.common.errors.RestconfError.ErrorType;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
@@ -129,7 +129,7 @@ public class RestconfImplTest {
     public void testExample() throws FileNotFoundException, ParseException {
         @SuppressWarnings("rawtypes")
         final NormalizedNode normalizedNodeData = TestUtils.prepareNormalizedNodeWithIetfInterfacesInterfacesData();
-        when(brokerFacade.readOperationalData(any(YangInstanceIdentifier.class))).thenReturn(normalizedNodeData);
+        when(brokerFacade.readOperationalData(isNull())).thenReturn(normalizedNodeData);
         assertEquals(normalizedNodeData,
                 brokerFacade.readOperationalData(null));
     }
@@ -155,7 +155,7 @@ public class RestconfImplTest {
                 .invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
         this.restconfImpl.invokeRpc("randomId", ctx, uriInfo);
         this.restconfImpl.invokeRpc("ietf-netconf", ctx, uriInfo);
-        verify(rpcService, times(2)).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
+        verify(rpcService, times(2)).invokeRpc(any(SchemaPath.class), isNull());
     }
 
     /**
index 19afc1dec53a902966c848917c84059af9b00f6b..dbadab2dc8f6d1ed7dad8241984d1c0c8a8cf017 100644 (file)
@@ -3,12 +3,7 @@
         "data-changed-notification": {
             "data-change-event": [
                 {
-                    "data": {
-                        "patch-cont": {
-                            "xmlns": "instance:identifier:patch:module"
-                        }
-                    },
-                    "operation": "updated",
+                    "operation": "deleted",
                     "path": "/instance-identifier-patch-module:patch-cont"
                 },
                 {
index 75c2dc10dfca400991f2bbb37e0f131d9283b787..4500cf4e6454200d930698ba18a8a99d3c5ad2a8 100644 (file)
@@ -32,7 +32,7 @@
       <artifactId>restconf-common</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
       <artifactId>rfc7895</artifactId>
     </dependency>
     <dependency>
@@ -74,8 +74,8 @@
     </dependency>
 
     <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-yang-types-20130715</artifactId>
+      <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+      <artifactId>rfc6991-ietf-yang-types</artifactId>
     </dependency>
 
     <dependency>
index 7e82357cf53c4a6c3d48fb98081ed7c81a372ff8..0fe0e08f84f06b370775a39371f3cb0948b20e53 100644 (file)
@@ -12,10 +12,10 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Matchers.isNull;
-import static org.mockito.Matchers.notNull;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
+import static org.mockito.ArgumentMatchers.notNull;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
@@ -494,8 +494,7 @@ public class JSONRestconfServiceRfc8040ImplTest {
         final SchemaPath path = SchemaPath.create(true, CANCEL_TOAST_QNAME);
 
         final DOMRpcResult expResult = new DefaultDOMRpcResult((NormalizedNode<?, ?>)null);
-        doReturn(Futures.immediateCheckedFuture(expResult)).when(mockRpcService).invokeRpc(eq(path),
-                any(NormalizedNode.class));
+        doReturn(Futures.immediateCheckedFuture(expResult)).when(mockRpcService).invokeRpc(eq(path), isNull());
 
         final String uriPath = "toaster:cancel-toast";
 
@@ -503,7 +502,7 @@ public class JSONRestconfServiceRfc8040ImplTest {
 
         assertEquals("Output present", false, output.isPresent());
 
-        verify(mockRpcService).invokeRpc(eq(path), isNull(NormalizedNode.class));
+        verify(mockRpcService).invokeRpc(eq(path), isNull());
     }
 
     @Test
@@ -514,8 +513,7 @@ public class JSONRestconfServiceRfc8040ImplTest {
                 .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_OUTPUT_QNAME))
                 .withChild(ImmutableNodes.leafNode(TEXT_OUT_QNAME, "foo")).build();
         final DOMRpcResult expResult = new DefaultDOMRpcResult(outputNode);
-        doReturn(Futures.immediateCheckedFuture(expResult)).when(mockRpcService).invokeRpc(eq(path),
-                any(NormalizedNode.class));
+        doReturn(Futures.immediateCheckedFuture(expResult)).when(mockRpcService).invokeRpc(eq(path), isNull());
 
         final String uriPath = "toaster:testOutput";
 
@@ -525,7 +523,7 @@ public class JSONRestconfServiceRfc8040ImplTest {
         assertNotNull("Returned null response", output.get());
         assertThat("Missing \"textOut\"", output.get(), containsString("\"textOut\":\"foo\""));
 
-        verify(mockRpcService).invokeRpc(eq(path), isNull(NormalizedNode.class));
+        verify(mockRpcService).invokeRpc(eq(path), isNull());
     }
 
     @Test(expected = OperationFailedException.class)
index 7ee842679a29347a14e4c1563bbc9ec08d533153..5285d85cda0662e63fb789bf27937433b93cc87f 100644 (file)
@@ -65,7 +65,7 @@ public class RestconfInvokeOperationsUtilTest {
         final DOMRpcResult rpcResult =
                 RestconfInvokeOperationsUtil.invokeRpc(DATA.input, DATA.errorRpc, serviceHandler);
         assertNull(rpcResult.getResult());
-        final Collection<RpcError> errorList = rpcResult.getErrors();
+        final Collection<? extends RpcError> errorList = rpcResult.getErrors();
         assertEquals(1, errorList.size());
         final RpcError actual = errorList.iterator().next();
         assertEquals("No implementation of RPC " + DATA.errorRpc.toString() + " available.", actual.getMessage());
index 8c2af38b3581afb1b516eaa6b708e3dd8f5996a8..a7cb21379d9fd50b60eb38fbb308f01fcf66d0bf 100644 (file)
@@ -3,12 +3,7 @@
         "data-changed-notification": {
             "data-change-event": [
                 {
-                    "data": {
-                        "patch-cont": {
-                            "xmlns": "instance:identifier:patch:module"
-                        }
-                    },
-                    "operation": "updated",
+                    "operation": "deleted",
                     "path": "/instance-identifier-patch-module:patch-cont"
                 },
                 {
index 12ebebc3ba3c483ca0047a321b6ffbc500919d24..3772336123ca5d4d0276336b2c0373868dd8e7dd 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>0.14.0-SNAPSHOT</version>
+    <version>3.0.1</version>
     <relativePath/>
   </parent>
 
         <type>pom</type>
         <scope>import</scope>
       </dependency>
-      <dependency>
-        <groupId>org.glassfish.jersey.test-framework.providers</groupId>
-        <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
-        <version>2.6</version>
-      </dependency>
     </dependencies>
   </dependencyManagement>
 
index 3b5442a364a60bd945ccc05f7ee8f3e681c5a7c4..4e61357e0551a8c5e9640a1fa280d016d5183f1e 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.3</version>
+    <version>4.0.2</version>
     <relativePath/>
   </parent>
 
index a8baa7774c544d7167c63a758b8a0b99c91741db..bb9b50565d22026e54f70178d1ca81398fd5e110 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.netconf.sal.rest.doc.jaxrs;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.Produces;
@@ -25,7 +24,6 @@ public class JaxbContextResolver implements ContextResolver<ObjectMapper> {
 
     public JaxbContextResolver() {
         ctx = new ObjectMapper();
-        ctx.getSerializationConfig().withSerializationInclusion(JsonInclude.Include.ALWAYS);
     }
 
     @Override