Merge changes I2e5faece,Ie34e98bd,Id2112fcb
authorJakub Morvay <jakub.morvay@gmail.com>
Wed, 16 Jan 2019 12:45:49 +0000 (12:45 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 16 Jan 2019 12:45:50 +0000 (12:45 +0000)
* changes:
  Eliminate unneeded test dependencies
  Remove org.jboss.resteasy/jaxrs-api dependency
  Remove use of Throwables.propagate()

15 files changed:
netconf/aaa-authn-odl-plugin/pom.xml
netconf/callhome-provider/pom.xml
netconf/mdsal-netconf-yang-library/pom.xml
netconf/messagebus-netconf/pom.xml
netconf/netconf-console/pom.xml
netconf/netconf-impl/pom.xml
netconf/netconf-topology-singleton/pom.xml
netconf/yanglib/pom.xml
restconf/restconf-common/pom.xml
restconf/restconf-nb-bierman02/pom.xml
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/NormalizedNodeXmlBodyWriter.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/RestconfDocumentedExceptionMapper.java
restconf/restconf-nb-rfc8040/pom.xml
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/NormalizedNodeXmlBodyWriter.java
restconf/sal-rest-docgen/pom.xml

index f8093bd6dc8d620a23bd37c0a8730ef779ca581d..6131ca775f0d278cde50ecacdd891e3d69b22ca9 100644 (file)
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <!-- Testing Dependencies -->
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
         </dependency>
     </dependencies>
-
 </project>
index dcb4b6fed9ad5f911a5c2c6998ef878842f9f60e..7eb2b1c0fcdab0c8f8755aa4e675ba704779ec8a 100644 (file)
@@ -40,9 +40,5 @@
             <artifactId>callhome-model</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-        </dependency>
     </dependencies>
 </project>
index 24494ec0c57c39f1722e93b2b5e6d0f69b0c3fee..4fc56a183c14d8090d7df28d7f0e6c199b4d2ca4 100644 (file)
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-test-util</artifactId>
index 382e469114623aa110bca4967cb1ac74abf1bcdb..47377cee1d09f110e77ec5ffa1145b3d3c19a44a 100644 (file)
@@ -67,11 +67,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
         </dependency>
 
         <!-- Testing Dependencies -->
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.hamcrest</groupId>
             <artifactId>hamcrest-core</artifactId>
index 678a3c43740f19fb0a1f6e1229b345d901589d57..2678901c28107c0a37fe8a1050b734f3be26388c 100644 (file)
@@ -34,11 +34,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
           <groupId>org.opendaylight.netconf</groupId>
           <artifactId>sal-netconf-connector</artifactId>
       </dependency>
-      <dependency>
-          <groupId>org.mockito</groupId>
-          <artifactId>mockito-core</artifactId>
-          <scope>test</scope>
-      </dependency>
       <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>yang-test-util</artifactId>
index c617dd19c23e05c007155724b7894fa099bcf4cc..d90d3d9018f15d993f22060d9c528f5267a15790 100644 (file)
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>netconf-client</artifactId>
index c1fffc99dec4a7db131875f1ca634ce3b7248d63..7009ca52d3b9800fab53a268a445e381121343af 100644 (file)
             <scope>test</scope>
         </dependency>
 
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-        </dependency>
         <dependency>
             <groupId>com.typesafe.akka</groupId>
             <artifactId>akka-testkit_2.12</artifactId>
index dcde35f1ccc39fda3d0545e0c60a55b6d2fec6f8..8f6e3946e4d638f3d6934dcf104cb0999986e55f 100644 (file)
             <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
             <artifactId>rfc7895</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-parser-impl</artifactId>
index e9babe1d0585c6f9f99540c9cc4d1af9c215db06..c1996dd63750f0d9165ebc3a98adf7f839dc20bb 100644 (file)
     </dependency>
 
     <dependency>
-      <groupId>org.jboss.resteasy</groupId>
-      <artifactId>jaxrs-api</artifactId>
-      <scope>provided</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>test</scope>
+      <groupId>javax.ws.rs</groupId>
+      <artifactId>javax.ws.rs-api</artifactId>
     </dependency>
   </dependencies>
 </project>
index 6e873be7ac5aa0dd5b99cf326f358cea712bad62..9cd37dd097081336e81e512758fe05a749eacd81 100644 (file)
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.jboss.resteasy</groupId>
-      <artifactId>jaxrs-api</artifactId>
-      <scope>provided</scope>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>yang-data-codec-gson</artifactId>
       <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.hamcrest</groupId>
       <artifactId>hamcrest-core</artifactId>
index df9b4f03b6bbea2de251268bd83293b72bb8018e..f4c1ec0af1d7338009bc23a96864fb391ba07686 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.netconf.sal.rest.impl;
 
 import com.google.common.base.Optional;
-import com.google.common.base.Throwables;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
@@ -138,10 +137,9 @@ public class NormalizedNodeXmlBodyWriter implements MessageBodyWriter<Normalized
     }
 
     private static void writeElements(final XMLStreamWriter xmlWriter, final RestconfNormalizedNodeWriter nnWriter,
-                               final ContainerNode data)
-            throws IOException {
+            final ContainerNode data) throws IOException {
+        final QName name = data.getNodeType();
         try {
-            final QName name = data.getNodeType();
             xmlWriter.writeStartElement(XMLConstants.DEFAULT_NS_PREFIX, name.getLocalName(),
                     name.getNamespace().toString());
             xmlWriter.writeDefaultNamespace(name.getNamespace().toString());
@@ -152,7 +150,7 @@ public class NormalizedNodeXmlBodyWriter implements MessageBodyWriter<Normalized
             xmlWriter.writeEndElement();
             xmlWriter.flush();
         } catch (final XMLStreamException e) {
-            Throwables.propagate(e);
+            throw new IOException("Failed to write elements", e);
         }
     }
 }
index 6f9616163431b22deb947d80bfad6a6fa925e5c4..a858efbd292addf61f74412c9521f62e2fd3f237 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.netconf.sal.rest.impl;
 
 import com.google.common.base.Preconditions;
-import com.google.common.base.Throwables;
 import com.google.common.collect.Iterables;
 import com.google.gson.stream.JsonWriter;
 import java.io.ByteArrayOutputStream;
@@ -365,10 +364,9 @@ public class RestconfDocumentedExceptionMapper implements ExceptionMapper<Restco
     }
 
     private static void writeRootElement(final XMLStreamWriter xmlWriter, final NormalizedNodeWriter nnWriter,
-                                         final ContainerNode data)
-            throws IOException {
+                                         final ContainerNode data) throws IOException {
+        final QName name = SchemaContext.NAME;
         try {
-            final QName name = SchemaContext.NAME;
             xmlWriter.writeStartElement(name.getNamespace().toString(), name.getLocalName());
             for (final DataContainerChild<? extends PathArgument, ?> child : data.getValue()) {
                 nnWriter.write(child);
@@ -377,7 +375,7 @@ public class RestconfDocumentedExceptionMapper implements ExceptionMapper<Restco
             xmlWriter.writeEndElement();
             xmlWriter.flush();
         } catch (final XMLStreamException e) {
-            Throwables.propagate(e);
+            throw new IOException("Failed to write elements", e);
         }
     }
 
index 9cd4b623e9018e50489daf0f62357cc0cad1e848..ed88e7a2a4b663bc621186fa0c6601d6c56fa10c 100644 (file)
       <artifactId>netty-codec-http</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>org.jboss.resteasy</groupId>
-      <artifactId>jaxrs-api</artifactId>
-      <scope>provided</scope>
-    </dependency>
-
     <dependency>
       <groupId>com.fasterxml.jackson.dataformat</groupId>
       <artifactId>jackson-dataformat-xml</artifactId>
       <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.glassfish.jersey.bundles.repackaged</groupId>
       <artifactId>jersey-guava</artifactId>
index 740bc195080f3d84b22aed9d48d50e3a829d3b52..49af300cf077c216cf9c69b74ea09dcdb9f2c571 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.restconf.nb.rfc8040.jersey.providers;
 
-import com.google.common.base.Throwables;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.lang.annotation.Annotation;
@@ -148,8 +147,8 @@ public class NormalizedNodeXmlBodyWriter implements MessageBodyWriter<Normalized
 
     private static void writeElements(final XMLStreamWriter xmlWriter, final RestconfNormalizedNodeWriter nnWriter,
             final ContainerNode data) throws IOException {
+        final QName name = data.getNodeType();
         try {
-            final QName name = data.getNodeType();
             xmlWriter.writeStartElement(XMLConstants.DEFAULT_NS_PREFIX,
                     name.getLocalName(), name.getNamespace().toString());
             xmlWriter.writeDefaultNamespace(name.getNamespace().toString());
@@ -160,7 +159,7 @@ public class NormalizedNodeXmlBodyWriter implements MessageBodyWriter<Normalized
             xmlWriter.writeEndElement();
             xmlWriter.flush();
         } catch (final XMLStreamException e) {
-            Throwables.propagate(e);
+            throw new IOException("Failed to write elements", e);
         }
     }
 }
index 7e984362ad93e98abcdee405e05d522542618aab..7dfb1b8f873b2f898ad1ad304102cb61ba1d9b2e 100644 (file)
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>yang-data-api</artifactId>