You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/07/23 16:08:51 UTC
[camel] 01/03: Camel-Exec: Use BindToRegistry where possible
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit b6aa809205bfdff6abd436d1e71cd283a0891ab2
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 23 18:05:34 2019 +0200
Camel-Exec: Use BindToRegistry where possible
---
.../org/apache/camel/component/exec/ExecJavaProcessTest.java | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecJavaProcessTest.java b/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecJavaProcessTest.java
index e35ec5d..0ebe7f2 100644
--- a/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecJavaProcessTest.java
+++ b/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecJavaProcessTest.java
@@ -20,6 +20,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
+import org.apache.camel.BindToRegistry;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
@@ -69,6 +70,9 @@ public class ExecJavaProcessTest extends CamelTestSupport {
private static final String EXECUTABLE_PROGRAM_ARG = ExecutableJavaProgram.class.getName();
+ @BindToRegistry("executorMock")
+ private ProvokeExceptionExecCommandExecutor provokerMock = new ProvokeExceptionExecCommandExecutor();
+
@Produce("direct:input")
ProducerTemplate producerTemplate;
@@ -80,13 +84,6 @@ public class ExecJavaProcessTest extends CamelTestSupport {
return true;
}
- @Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry registry = super.createRegistry();
- registry.bind("executorMock", new ProvokeExceptionExecCommandExecutor());
- return registry;
- }
-
@Test
public void testExecJavaProcessExitCode0() throws Exception {
context.start();