This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 830cd11711d1ec91570af977a739b34dfd02a788 Author: Otavio Rodolfo Piske <angusyo...@gmail.com> AuthorDate: Fri Apr 8 15:10:44 2022 +0200 CAMEL-17763: cleanup unused exceptions in camel-disruptor --- .../camel/component/disruptor/DisruptorConcurrentTest.java | 2 +- .../camel/component/disruptor/DisruptorConfigureTest.java | 10 +++++----- .../component/disruptor/DisruptorInOutChainedTimeoutTest.java | 2 +- .../camel/component/disruptor/DisruptorNoConsumerTest.java | 4 ++-- .../camel/component/disruptor/DisruptorRingBufferTest.java | 2 +- .../disruptor/DisruptorWaitForTaskAsPropertyTest.java | 2 +- .../component/disruptor/DisruptorWaitForTaskCompleteTest.java | 2 +- .../disruptor/DisruptorWaitForTaskIfReplyExpectedTest.java | 2 +- .../component/disruptor/DisruptorWaitForTaskNeverTest.java | 2 +- .../camel/component/disruptor/SedaDisruptorCompareTest.java | 3 +-- .../disruptor/vm/DisruptorVmInOutChainedTimeoutTest.java | 2 +- .../camel/component/disruptor/vm/DisruptorVmQueueTest.java | 2 +- .../component/disruptor/vm/DisruptorVmTimeoutIssueTest.java | 4 ++-- .../disruptor/vm/DisruptorVmWaitForTaskCompleteTest.java | 2 +- .../vm/DisruptorVmWaitForTaskIfReplyExpectedTest.java | 2 +- .../disruptor/vm/DisruptorVmWaitForTaskNewerTest.java | 2 +- .../disruptor/vm/SameDisruptorVmQueueSizeAndNoSizeTest.java | 6 +++--- 17 files changed, 25 insertions(+), 26 deletions(-) diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorConcurrentTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorConcurrentTest.java index aad84ec2314..a7698db974a 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorConcurrentTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorConcurrentTest.java @@ -79,7 +79,7 @@ public class DisruptorConcurrentTest extends CamelTestSupport { final int num = i; final Object out = executors.submit(new Callable<Object>() { @Override - public Object call() throws Exception { + public Object call() { return template.requestBody("disruptor:bar", "Message " + num); } }); diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorConfigureTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorConfigureTest.java index e7b497b67bf..83d8a2bdb37 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorConfigureTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorConfigureTest.java @@ -34,7 +34,7 @@ public class DisruptorConfigureTest extends CamelTestSupport { } @Test - void testIllegalSizeZeroConfigured() throws Exception { + void testIllegalSizeZeroConfigured() { try { resolveMandatoryEndpoint("disruptor:foo?size=0", DisruptorEndpoint.class); fail("Should have thrown exception"); @@ -63,7 +63,7 @@ public class DisruptorConfigureTest extends CamelTestSupport { } @Test - void testDefaultMultipleConsumersComponentProperty() throws Exception { + void testDefaultMultipleConsumersComponentProperty() { final DisruptorComponent disruptor = context.getComponent("disruptor", DisruptorComponent.class); disruptor.setDefaultMultipleConsumers(true); assertEquals(true, disruptor.isDefaultMultipleConsumers()); @@ -80,7 +80,7 @@ public class DisruptorConfigureTest extends CamelTestSupport { } @Test - void testDefaultProducerTypeComponentProperty() throws Exception { + void testDefaultProducerTypeComponentProperty() { final DisruptorComponent disruptor = context.getComponent("disruptor", DisruptorComponent.class); disruptor.setDefaultProducerType(DisruptorProducerType.Single); assertEquals(DisruptorProducerType.Single, disruptor.getDefaultProducerType()); @@ -97,7 +97,7 @@ public class DisruptorConfigureTest extends CamelTestSupport { } @Test - void testDefaultWaitStrategyComponentProperty() throws Exception { + void testDefaultWaitStrategyComponentProperty() { final DisruptorComponent disruptor = context.getComponent("disruptor", DisruptorComponent.class); disruptor.setDefaultWaitStrategy(DisruptorWaitStrategy.BusySpin); assertEquals(DisruptorWaitStrategy.BusySpin, disruptor.getDefaultWaitStrategy()); @@ -114,7 +114,7 @@ public class DisruptorConfigureTest extends CamelTestSupport { } @Test - void testDefaultConcurrentConsumersComponentProperty() throws Exception { + void testDefaultConcurrentConsumersComponentProperty() { final DisruptorComponent disruptor = context.getComponent("disruptor", DisruptorComponent.class); disruptor.setDefaultConcurrentConsumers(5); assertEquals(5, disruptor.getDefaultConcurrentConsumers()); diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorInOutChainedTimeoutTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorInOutChainedTimeoutTest.java index c506c75c661..dbc476e8599 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorInOutChainedTimeoutTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorInOutChainedTimeoutTest.java @@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class DisruptorInOutChainedTimeoutTest extends CamelTestSupport { @Test - void testDisruptorInOutChainedTimeout() throws Exception { + void testDisruptorInOutChainedTimeout() { // time timeout after 2 sec should trigger a immediately reply final StopWatch watch = new StopWatch(); try { diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorNoConsumerTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorNoConsumerTest.java index 8fb9ac8e879..c90371a79a5 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorNoConsumerTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorNoConsumerTest.java @@ -28,13 +28,13 @@ import static org.junit.jupiter.api.Assertions.fail; public class DisruptorNoConsumerTest extends CamelTestSupport { @Test - void testInOnly() throws Exception { + void testInOnly() { // no problem for in only as we do not expect a reply assertDoesNotThrow(() -> template.sendBody("direct:start", "Hello World")); } @Test - void testInOut() throws Exception { + void testInOut() { try { template.requestBody("direct:start", "Hello World"); fail("Should throw an exception"); diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorRingBufferTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorRingBufferTest.java index bfae6a6ba66..cf52b7f607b 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorRingBufferTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorRingBufferTest.java @@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test; public class DisruptorRingBufferTest extends CamelTestSupport { @Test - void testQueue() throws Exception { + void testQueue() { final MockEndpoint mock = getMockEndpoint("mock:result"); mock.expectedBodiesReceivedInAnyOrder("Hello World", "Bye World", "Goodday World", "Bar"); diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskAsPropertyTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskAsPropertyTest.java index 3a0b69a212c..800bc4b3835 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskAsPropertyTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskAsPropertyTest.java @@ -50,7 +50,7 @@ public class DisruptorWaitForTaskAsPropertyTest extends CamelTestSupport { final Exchange out = template.send("direct:start", new Processor() { @Override - public void process(final Exchange exchange) throws Exception { + public void process(final Exchange exchange) { exchange.getIn().setBody("Hello World"); exchange.setPattern(ExchangePattern.InOnly); exchange.setProperty(Exchange.ASYNC_WAIT, WaitForTaskToComplete.IfReplyExpected); diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskCompleteTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskCompleteTest.java index eab31cf795a..76375c15032 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskCompleteTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskCompleteTest.java @@ -44,7 +44,7 @@ public class DisruptorWaitForTaskCompleteTest extends CamelTestSupport { // and since the route changes the payload we can get the response anyway final Exchange out = template.send("direct:start", new Processor() { @Override - public void process(final Exchange exchange) throws Exception { + public void process(final Exchange exchange) { exchange.getIn().setBody("Hello World"); exchange.setPattern(ExchangePattern.InOnly); } diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskIfReplyExpectedTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskIfReplyExpectedTest.java index 0b00b0800fe..102b308eaad 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskIfReplyExpectedTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskIfReplyExpectedTest.java @@ -41,7 +41,7 @@ public class DisruptorWaitForTaskIfReplyExpectedTest extends CamelTestSupport { getMockEndpoint("mock:result").expectedBodiesReceived("Bye World"); final Exchange out = template.send("direct:start", new Processor() { @Override - public void process(final Exchange exchange) throws Exception { + public void process(final Exchange exchange) { exchange.getIn().setBody("Hello World"); exchange.setPattern(ExchangePattern.InOnly); } diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskNeverTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskNeverTest.java index 63103ed1fd2..4454007a633 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskNeverTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/DisruptorWaitForTaskNeverTest.java @@ -43,7 +43,7 @@ public class DisruptorWaitForTaskNeverTest extends CamelTestSupport { final Exchange out = template.send("direct:start", new Processor() { @Override - public void process(final Exchange exchange) throws Exception { + public void process(final Exchange exchange) { exchange.getIn().setBody("Hello World"); exchange.setPattern(ExchangePattern.InOnly); } diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/SedaDisruptorCompareTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/SedaDisruptorCompareTest.java index 7e034050aeb..872b034a3b3 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/SedaDisruptorCompareTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/SedaDisruptorCompareTest.java @@ -260,8 +260,7 @@ public class SedaDisruptorCompareTest extends CamelTestSupport { } } - private void outputExchangeAwaitersResult(String componentName, final long start, ExchangeAwaiter[] exchangeAwaiters) - throws InterruptedException { + private void outputExchangeAwaitersResult(String componentName, final long start, ExchangeAwaiter[] exchangeAwaiters) { for (final ExchangeAwaiter exchangeAwaiter : exchangeAwaiters) { final long stop = exchangeAwaiter.getCountDownReachedTime(); final Histogram histogram = exchangeAwaiter.getLatencyHistogram(); diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmInOutChainedTimeoutTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmInOutChainedTimeoutTest.java index 7bc473e411b..57b86d9e56d 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmInOutChainedTimeoutTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmInOutChainedTimeoutTest.java @@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class DisruptorVmInOutChainedTimeoutTest extends AbstractVmTestSupport { @Test - void testDisruptorVmInOutChainedTimeout() throws Exception { + void testDisruptorVmInOutChainedTimeout() { StopWatch watch = new StopWatch(); try { diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmQueueTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmQueueTest.java index 5c8f7b934ef..2ffd10a42cc 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmQueueTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmQueueTest.java @@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test; public class DisruptorVmQueueTest extends AbstractVmTestSupport { @Test - void testQueue() throws Exception { + void testQueue() { MockEndpoint mock = getMockEndpoint("mock:result"); mock.expectedBodiesReceivedInAnyOrder("Hello World", "Bye World", "Goodday World", "Bar"); diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmTimeoutIssueTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmTimeoutIssueTest.java index 144883d197f..0ab87032031 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmTimeoutIssueTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmTimeoutIssueTest.java @@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class DisruptorVmTimeoutIssueTest extends AbstractVmTestSupport { @Test - void testDisruptorVmTimeoutWithAnotherDisruptorVm() throws Exception { + void testDisruptorVmTimeoutWithAnotherDisruptorVm() { try { template2.requestBody("disruptor-vm:start1?timeout=4000", "Hello"); fail("Should have thrown an exception"); @@ -42,7 +42,7 @@ public class DisruptorVmTimeoutIssueTest extends AbstractVmTestSupport { } @Test - void testDisruptorVmTimeoutWithProcessor() throws Exception { + void testDisruptorVmTimeoutWithProcessor() { try { template2.requestBody("disruptor-vm:start2?timeout=4000", "Hello"); fail("Should have thrown an exception"); diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskCompleteTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskCompleteTest.java index ee7414a07ac..b116390be42 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskCompleteTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskCompleteTest.java @@ -43,7 +43,7 @@ public class DisruptorVmWaitForTaskCompleteTest extends AbstractVmTestSupport { // we send an in only but we use Always to wait for it to complete // and since the route changes the payload we can get the response anyway Exchange out = template2.send("direct:start", new Processor() { - public void process(Exchange exchange) throws Exception { + public void process(Exchange exchange) { exchange.getIn().setBody("Hello World"); exchange.setPattern(ExchangePattern.InOnly); } diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskIfReplyExpectedTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskIfReplyExpectedTest.java index 20c0b185959..94cd5e7a70d 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskIfReplyExpectedTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskIfReplyExpectedTest.java @@ -41,7 +41,7 @@ public class DisruptorVmWaitForTaskIfReplyExpectedTest extends AbstractVmTestSup getMockEndpoint("mock:result").expectedBodiesReceived("Bye World"); Exchange out = template2.send("direct:start", new Processor() { - public void process(Exchange exchange) throws Exception { + public void process(Exchange exchange) { exchange.getIn().setBody("Hello World"); exchange.setPattern(ExchangePattern.InOnly); } diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskNewerTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskNewerTest.java index 271c77e7c43..994abebff0d 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskNewerTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/DisruptorVmWaitForTaskNewerTest.java @@ -42,7 +42,7 @@ public class DisruptorVmWaitForTaskNewerTest extends AbstractVmTestSupport { getMockEndpoint("mock:result").expectedBodiesReceived("Bye World"); Exchange out = template2.send("direct:start", new Processor() { - public void process(Exchange exchange) throws Exception { + public void process(Exchange exchange) { exchange.getIn().setBody("Hello World"); exchange.setPattern(ExchangePattern.InOnly); } diff --git a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/SameDisruptorVmQueueSizeAndNoSizeTest.java b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/SameDisruptorVmQueueSizeAndNoSizeTest.java index dd681234614..b5936a0a8b4 100644 --- a/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/SameDisruptorVmQueueSizeAndNoSizeTest.java +++ b/components/camel-disruptor/src/test/java/org/apache/camel/component/disruptor/vm/SameDisruptorVmQueueSizeAndNoSizeTest.java @@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class SameDisruptorVmQueueSizeAndNoSizeTest extends CamelTestSupport { @Test - void testSameQueue() throws Exception { + void testSameQueue() { for (int i = 0; i < 128; i++) { template.sendBody("disruptor-vm:foo?blockWhenFull=false", "" + i); } @@ -47,7 +47,7 @@ public class SameDisruptorVmQueueSizeAndNoSizeTest extends CamelTestSupport { } @Test - void testSameQueueDifferentSize() throws Exception { + void testSameQueueDifferentSize() { try { template.sendBody("disruptor-vm:foo?size=256", "Should fail"); fail("Should fail"); @@ -60,7 +60,7 @@ public class SameDisruptorVmQueueSizeAndNoSizeTest extends CamelTestSupport { } @Test - void testSameQueueDifferentSizeBar() throws Exception { + void testSameQueueDifferentSizeBar() { try { template.sendBody("disruptor-vm:bar?size=256", "Should fail"); fail("Should fail");