You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2019/06/06 17:46:37 UTC

[camel] branch master updated: Fixed unused and deprecated statements

This is an automated email from the ASF dual-hosted git repository.

aldettinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c2649c  Fixed unused and deprecated statements
1c2649c is described below

commit 1c2649cc3783b805f62c0e77ac1958f6ea77f358
Author: aldettinger <al...@gmail.com>
AuthorDate: Thu Jun 6 19:38:03 2019 +0200

    Fixed unused and deprecated statements
---
 .../apache/camel/component/ahc/ws/WsEndpoint.java  |  2 --
 .../camel/component/atom/AtomEntrySortTest.java    |  2 --
 .../camel/component/atom/JettyTestServer.java      |  3 +-
 .../component/github/GitHubComponentTestBase.java  | 33 ++++++----------------
 4 files changed, 11 insertions(+), 29 deletions(-)

diff --git a/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsEndpoint.java b/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsEndpoint.java
index 7edd1fa..764ef50 100644
--- a/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsEndpoint.java
+++ b/components/camel-ahc-ws/src/main/java/org/apache/camel/component/ahc/ws/WsEndpoint.java
@@ -33,8 +33,6 @@ import org.asynchttpclient.DefaultAsyncHttpClientConfig;
 import org.asynchttpclient.ws.WebSocket;
 import org.asynchttpclient.ws.WebSocketListener;
 import org.asynchttpclient.ws.WebSocketUpgradeHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * To exchange data with external Websocket servers using <a href="http://github.com/sonatype/async-http-client">Async Http Client</a>.
diff --git a/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomEntrySortTest.java b/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomEntrySortTest.java
index 9ef25e6..2b2dbf5 100644
--- a/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomEntrySortTest.java
+++ b/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomEntrySortTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.atom;
 
-import java.text.SimpleDateFormat;
 import java.util.Date;
 
 import org.apache.abdera.model.Entry;
@@ -50,7 +49,6 @@ public class AtomEntrySortTest extends CamelTestSupport {
 
     @Override
     protected void bindToRegistry(Registry registry) throws Exception {
-        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
         registry.bind("myBean", new MyBean());
     }
 
diff --git a/components/camel-atom/src/test/java/org/apache/camel/component/atom/JettyTestServer.java b/components/camel-atom/src/test/java/org/apache/camel/component/atom/JettyTestServer.java
index b3ad821..810b5ab 100644
--- a/components/camel-atom/src/test/java/org/apache/camel/component/atom/JettyTestServer.java
+++ b/components/camel-atom/src/test/java/org/apache/camel/component/atom/JettyTestServer.java
@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.camel.test.AvailablePortFinder;
+import org.apache.commons.codec.Charsets;
 import org.apache.commons.io.FileUtils;
 import org.eclipse.jetty.security.ConstraintMapping;
 import org.eclipse.jetty.security.ConstraintSecurityHandler;
@@ -124,7 +125,7 @@ public final class JettyTestServer {
 
         @Override
         protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-            resp.getWriter().write(FileUtils.readFileToString(new File("src/test/data/feed.atom")));
+            resp.getWriter().write(FileUtils.readFileToString(new File("src/test/data/feed.atom"), Charsets.UTF_8));
         }
     }
 
diff --git a/components/camel-github/src/test/java/org/apache/camel/component/github/GitHubComponentTestBase.java b/components/camel-github/src/test/java/org/apache/camel/component/github/GitHubComponentTestBase.java
index b7f6919..bd8fd61 100644
--- a/components/camel-github/src/test/java/org/apache/camel/component/github/GitHubComponentTestBase.java
+++ b/components/camel-github/src/test/java/org/apache/camel/component/github/GitHubComponentTestBase.java
@@ -16,48 +16,33 @@
  */
 package org.apache.camel.component.github;
 
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.github.services.MockCommitService;
 import org.apache.camel.component.github.services.MockIssueService;
 import org.apache.camel.component.github.services.MockPullRequestService;
 import org.apache.camel.component.github.services.MockRepositoryService;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 public abstract class GitHubComponentTestBase extends CamelTestSupport {
 
-    protected MockCommitService commitService;
-    protected MockRepositoryService repositoryService;
-    protected MockPullRequestService pullRequestService;
-    protected MockIssueService issueService;
+    @BindToRegistry(GitHubConstants.GITHUB_COMMIT_SERVICE)
+    protected MockCommitService commitService = new MockCommitService();
+    @BindToRegistry(GitHubConstants.GITHUB_REPOSITORY_SERVICE)
+    protected MockRepositoryService repositoryService = new MockRepositoryService();
+    @BindToRegistry(GitHubConstants.GITHUB_PULL_REQUEST_SERVICE)
+    protected MockPullRequestService pullRequestService = new MockPullRequestService();
+    @BindToRegistry(GitHubConstants.GITHUB_ISSUE_SERVICE)
+    protected MockIssueService issueService = new MockIssueService(pullRequestService);
 
     @EndpointInject("mock:result")
     protected MockEndpoint mockResultEndpoint;
 
-    @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
-        commitService = new MockCommitService();
-        registry.bind(GitHubConstants.GITHUB_COMMIT_SERVICE, commitService);
-
-        repositoryService = new MockRepositoryService();
-        registry.bind(GitHubConstants.GITHUB_REPOSITORY_SERVICE, repositoryService);
-
-        pullRequestService = new MockPullRequestService();
-        registry.bind(GitHubConstants.GITHUB_PULL_REQUEST_SERVICE, pullRequestService);
-
-        issueService = new MockIssueService(pullRequestService);
-        registry.bind(GitHubConstants.GITHUB_ISSUE_SERVICE, issueService);
-
-        return registry;
-    }
-
     @Test
     public void emptyAtStartupTest() throws Exception {
         mockResultEndpoint.expectedMessageCount(0);
         mockResultEndpoint.assertIsSatisfied();
     }
-
 }