You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/04/24 06:28:09 UTC

(camel) branch main updated (c2b21559da2 -> 00f756c039c)

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

orpiske pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


    from c2b21559da2 CAMEL-20513 - Camel-AWS-Bedrock: Support Amazon Titan Multimodal Embeddings G1 Model (#13896)
     new f234169d47b (chores) camel-core: correctly disabled manual tests
     new 6d5fa67ebe9 (chores) camel-core: fix incorrect test without assertions
     new 88d7210ff2a (chores) camel-core: remove unused code
     new 675a527618a (chores) camel-core: added unused suppressions to methods used indirectly
     new 00f756c039c (chores) camel-core: removed likely incorrect performance tests

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel/impl/cloud/ServiceRegistryTest.java      |   4 -
 .../apache/camel/builder/xml/XPathFeatureTest.java |  21 ---
 .../camel/cluster/ClusterServiceSelectorTest.java  |   8 -
 .../cluster/ClusteredRoutePolicyFactoryTest.java   |   8 -
 .../camel/component/bean/BeanConcurrentTest.java   |   1 +
 .../bean/BeanExpressionConcurrentTest.java         |   1 +
 .../bean/BeanInfoAMoreComplexOverloadedTest.java   |   1 +
 .../component/bean/BeanInfoInheritanceTest.java    |   1 +
 .../component/bean/BeanInfoOverloadedTest.java     |   1 +
 .../BeanInfoOverloadedWithSubTypeParamTest.java    |   1 +
 .../apache/camel/component/bean/BeanInfoTest.java  |   3 +
 .../camel/component/bean/BeanInvokeTest.java       |   3 +
 .../camel/component/bean/BeanLifecycleTest.java    |   1 +
 .../bean/issues/BeanThisAdviceWithIssueTest.java   |   1 +
 .../file/FileConsumerIdempotentRefTest.java        |   1 -
 .../camel/impl/DataFormatContextAwareTest.java     |  10 --
 .../DefaultComponentReferencePropertiesTest.java   |   5 -
 .../impl/DefaultExecutorServiceManagerTest.java    |   2 +-
 .../org/apache/camel/impl/RefDataFormatTest.java   |  10 --
 .../org/apache/camel/impl/RouteNoOutputTest.java   |  24 +--
 .../impl/TypeConverterRegistryPerformanceTest.java |  79 ----------
 .../camel/impl/engine/DefaultCamelContextTest.java |  10 --
 ...irIteratorSplitChoicePerformanceManualTest.java | 174 --------------------
 .../XPathSplitChoicePerformanceManualTest.java     | 175 ---------------------
 .../CreateRouteWithNonExistingEndpointTest.java    |  10 +-
 .../camel/processor/DataFormatServiceTest.java     |  10 --
 .../DeadLetterChannelUnmarshalSetHeaderTest.java   |  10 --
 .../camel/processor/PipelineStepWithEventTest.java |  10 --
 .../camel/processor/RouteAwareProcessorTest.java   |  10 --
 .../camel/processor/RouteAwareRouteTest.java       |  10 --
 .../processor/RouteContextProcessorManualTest.java |   6 +-
 ...RouteWithConstantFieldFromExchangeFailTest.java |  11 +-
 .../camel/processor/UnmarshalProcessorTest.java    |  10 --
 .../aggregator/AggregateTimeoutManualTest.java     |  10 +-
 .../AggregationStrategyLifecycleTest.java          |   5 -
 .../AsyncEndpointEventNotifierSendingTest.java     |   4 -
 .../errorhandler/ErrorHandlerSupportTest.java      |   8 -
 .../camel/processor/resequencer/SequenceTest.java  |   5 -
 .../processor/resequencer/TestComparatorTest.java  |   5 -
 .../apache/camel/support/ServiceSupportTest.java   |  21 ---
 .../apache/camel/util/CaseInsensitiveMapTest.java  |   2 +-
 .../org/apache/camel/util/EventHelperTest.java     |   8 -
 .../org/apache/camel/util/ObjectHelperTest.java    |   1 +
 .../management/ManagedCustomProcessorTest.java     |  10 --
 .../management/ManagedNonManagedServiceTest.java   |  18 ---
 45 files changed, 48 insertions(+), 681 deletions(-)
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/impl/TypeConverterRegistryPerformanceTest.java
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/language/TokenPairIteratorSplitChoicePerformanceManualTest.java
 delete mode 100644 core/camel-core/src/test/java/org/apache/camel/language/XPathSplitChoicePerformanceManualTest.java


(camel) 01/05: (chores) camel-core: correctly disabled manual tests

Posted by or...@apache.org.
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 f234169d47bdb44f412f059ed4970a4ad6f8459b
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Apr 22 13:31:24 2024 +0200

    (chores) camel-core: correctly disabled manual tests
---
 .../apache/camel/impl/DefaultExecutorServiceManagerTest.java   |  2 +-
 .../camel/processor/RouteContextProcessorManualTest.java       |  6 +-----
 .../camel/processor/aggregator/AggregateTimeoutManualTest.java | 10 ++++------
 .../java/org/apache/camel/util/CaseInsensitiveMapTest.java     |  2 +-
 4 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceManagerTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceManagerTest.java
index d75d5152123..6f3bff5923a 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceManagerTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceManagerTest.java
@@ -534,7 +534,7 @@ public class DefaultExecutorServiceManagerTest extends ContextTestSupport {
     }
 
     @Disabled("This is a manual test, by looking at the logs")
-    public void xxxtestLongShutdownOfThreadPool() throws Exception {
+    public void testLongShutdownOfThreadPool() throws Exception {
         final CountDownLatch latch = new CountDownLatch(1);
         ExecutorService pool = context.getExecutorServiceManager().newSingleThreadExecutor(this, "Cool");
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/RouteContextProcessorManualTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/RouteContextProcessorManualTest.java
index e10f3b45630..1973d211a59 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/RouteContextProcessorManualTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/RouteContextProcessorManualTest.java
@@ -50,11 +50,7 @@ public class RouteContextProcessorManualTest extends ContextTestSupport {
     private static final int NUMBER_OF_MESSAGES = 10000;
 
     @Test
-    public void testForkAndJoin() {
-        // enable the other test method for manual testing
-    }
-
-    public void xxxTestForkAndJoin() throws InterruptedException {
+    public void testForkAndJoin() throws InterruptedException {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(NUMBER_OF_MESSAGES);
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutManualTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutManualTest.java
index 7521de18d9f..8ef06425c7b 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutManualTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutManualTest.java
@@ -20,21 +20,19 @@ import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 /**
  * To be run manually when testing the timeout aggregator
  */
+@Disabled("This is a manual test")
 public class AggregateTimeoutManualTest extends ContextTestSupport {
 
     @Test
-    public void testDisabled() {
-        // noop
-    }
-
-    public void xxxtestAggregateTimeoutManual() throws Exception {
+    public void testAggregateTimeoutManual() throws Exception {
         MockEndpoint result = getMockEndpoint("mock:result");
-        // by default the use latest aggregation strategy
+        // by default, the use latest aggregation strategy
         result.expectedBodiesReceived("Message 1999");
         // should take at least 3 seconds to complete this one
         result.setResultMinimumWaitTime(2500);
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java b/core/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java
index 86733ac4ae6..68af18d0531 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java
@@ -503,7 +503,7 @@ public class CaseInsensitiveMapTest {
     }
 
     @Disabled("Manual test")
-    public void xxxTestCopyMapWithCamelHeadersTest() throws Exception {
+    public void testCopyMapWithCamelHeadersTest() throws Exception {
         Map<String, Object> map = new CaseInsensitiveMap();
         map.put("CamelA", "A");
         map.put("CamelB", "B");


(camel) 03/05: (chores) camel-core: remove unused code

Posted by or...@apache.org.
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 88d7210ff2a40c3a339f2ab3932860bdb2561d84
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Apr 22 13:39:11 2024 +0200

    (chores) camel-core: remove unused code
---
 .../camel/impl/cloud/ServiceRegistryTest.java       |  4 ----
 .../apache/camel/builder/xml/XPathFeatureTest.java  | 21 ---------------------
 .../camel/cluster/ClusterServiceSelectorTest.java   |  8 --------
 .../cluster/ClusteredRoutePolicyFactoryTest.java    |  8 --------
 .../file/FileConsumerIdempotentRefTest.java         |  1 -
 .../camel/impl/DataFormatContextAwareTest.java      | 10 ----------
 .../DefaultComponentReferencePropertiesTest.java    |  5 -----
 .../org/apache/camel/impl/RefDataFormatTest.java    | 10 ----------
 .../org/apache/camel/impl/RouteNoOutputTest.java    |  1 -
 .../camel/impl/engine/DefaultCamelContextTest.java  | 10 ----------
 .../camel/processor/DataFormatServiceTest.java      | 10 ----------
 .../DeadLetterChannelUnmarshalSetHeaderTest.java    | 10 ----------
 .../camel/processor/PipelineStepWithEventTest.java  | 10 ----------
 .../camel/processor/RouteAwareProcessorTest.java    | 10 ----------
 .../apache/camel/processor/RouteAwareRouteTest.java | 10 ----------
 .../camel/processor/UnmarshalProcessorTest.java     | 10 ----------
 .../AggregationStrategyLifecycleTest.java           |  5 -----
 .../AsyncEndpointEventNotifierSendingTest.java      |  4 ----
 .../errorhandler/ErrorHandlerSupportTest.java       |  8 --------
 .../camel/processor/resequencer/SequenceTest.java   |  5 -----
 .../processor/resequencer/TestComparatorTest.java   |  5 -----
 .../apache/camel/support/ServiceSupportTest.java    | 21 ---------------------
 .../java/org/apache/camel/util/EventHelperTest.java |  8 --------
 .../management/ManagedCustomProcessorTest.java      | 10 ----------
 .../management/ManagedNonManagedServiceTest.java    | 18 ------------------
 25 files changed, 222 deletions(-)

diff --git a/core/camel-cloud/src/test/java/org/apache/camel/impl/cloud/ServiceRegistryTest.java b/core/camel-cloud/src/test/java/org/apache/camel/impl/cloud/ServiceRegistryTest.java
index 5a1237f8483..e5ff5c71875 100644
--- a/core/camel-cloud/src/test/java/org/apache/camel/impl/cloud/ServiceRegistryTest.java
+++ b/core/camel-cloud/src/test/java/org/apache/camel/impl/cloud/ServiceRegistryTest.java
@@ -206,10 +206,6 @@ public class ServiceRegistryTest extends ContextTestSupport {
             definitions.remove(definition.getId());
         }
 
-        @Override
-        protected void doStart() {
-        }
-
         @Override
         protected void doStop() {
             definitions.clear();
diff --git a/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathFeatureTest.java b/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathFeatureTest.java
index 0a7880a551d..5da8da7b13c 100644
--- a/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathFeatureTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathFeatureTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.NoTypeConversionAvailableException;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.TypeConversionException;
 import org.apache.camel.converter.jaxp.XmlConverter;
-import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.parallel.ResourceLock;
 import org.junit.jupiter.api.parallel.Resources;
@@ -44,26 +43,6 @@ public class XPathFeatureTest extends ContextTestSupport {
             = " <!DOCTYPE foo [ "
               + " <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM \"file:///bin/test.sh\" >]> <test> &xxe; </test><notwellformed>";
 
-    @Override
-    @BeforeEach
-    public void setUp() throws Exception {
-        resetCoreConverters();
-        super.setUp();
-    }
-
-    private void resetCoreConverters() {
-        /*
-         * Field field =
-         * CoreStaticTypeConverterLoader.class.getDeclaredField("INSTANCE");
-         * field.setAccessible(true); Field modifiersField =
-         * Field.class.getDeclaredField("modifiers");
-         * modifiersField.setAccessible(true); modifiersField.setInt(field,
-         * field.getModifiers() & ~Modifier.FINAL); Constructor<?> cns =
-         * CoreStaticTypeConverterLoader.class.getDeclaredConstructor();
-         * cns.setAccessible(true); field.set(null, cns.newInstance());
-         */
-    }
-
     @Override
     public boolean isUseRouteBuilder() {
         return false;
diff --git a/core/camel-core/src/test/java/org/apache/camel/cluster/ClusterServiceSelectorTest.java b/core/camel-core/src/test/java/org/apache/camel/cluster/ClusterServiceSelectorTest.java
index 2048d0d10ae..0a0d19b92f5 100644
--- a/core/camel-core/src/test/java/org/apache/camel/cluster/ClusterServiceSelectorTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/cluster/ClusterServiceSelectorTest.java
@@ -384,14 +384,6 @@ public class ClusterServiceSelectorTest {
             return Collections.emptyList();
         }
 
-        @Override
-        protected void doStart() {
-        }
-
-        @Override
-        protected void doStop() {
-        }
-
         private final class DummyClusterServiceMember implements CamelClusterMember {
             private final boolean leader;
             private final boolean local;
diff --git a/core/camel-core/src/test/java/org/apache/camel/cluster/ClusteredRoutePolicyFactoryTest.java b/core/camel-core/src/test/java/org/apache/camel/cluster/ClusteredRoutePolicyFactoryTest.java
index 20f06117060..288f011947a 100644
--- a/core/camel-core/src/test/java/org/apache/camel/cluster/ClusteredRoutePolicyFactoryTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/cluster/ClusteredRoutePolicyFactoryTest.java
@@ -174,14 +174,6 @@ public class ClusteredRoutePolicyFactoryTest extends ContextTestSupport {
             return Collections.emptyList();
         }
 
-        @Override
-        protected void doStart() {
-        }
-
-        @Override
-        protected void doStop() {
-        }
-
         public boolean isLeader() {
             return leader;
         }
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIdempotentRefTest.java b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIdempotentRefTest.java
index a9227945d83..9cc234c810f 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIdempotentRefTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIdempotentRefTest.java
@@ -112,7 +112,6 @@ public class FileConsumerIdempotentRefTest extends ContextTestSupport {
 
         @Override
         public void clear() {
-            return;
         }
 
         @Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DataFormatContextAwareTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DataFormatContextAwareTest.java
index ebf4e18ac7e..60dbcddda27 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DataFormatContextAwareTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DataFormatContextAwareTest.java
@@ -75,15 +75,5 @@ public class DataFormatContextAwareTest extends ContextTestSupport {
         public Object unmarshal(Exchange exchange, InputStream stream) {
             return null;
         }
-
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
 }
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentReferencePropertiesTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentReferencePropertiesTest.java
index 6ea18d40d6d..b4ede661aa4 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentReferencePropertiesTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultComponentReferencePropertiesTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.impl;
 
-import java.util.List;
 import java.util.Map;
 
 import org.apache.camel.CamelContext;
@@ -72,10 +71,6 @@ public class DefaultComponentReferencePropertiesTest extends ContextTestSupport
             return null;
         }
 
-        public void setExpression(List<?> expressions) {
-            // do nothing
-        }
-
         public void setExpression(Expression expression) {
             this.expression = expression;
         }
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/RefDataFormatTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/RefDataFormatTest.java
index 57c6da40329..6ebb7e6984c 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/RefDataFormatTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/RefDataFormatTest.java
@@ -95,16 +95,6 @@ public class RefDataFormatTest extends ContextTestSupport {
             }
             return sb.toString();
         }
-
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
     // END SNIPPET: e2
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/RouteNoOutputTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/RouteNoOutputTest.java
index 5163b71c6b1..fa23483fa08 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/RouteNoOutputTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/RouteNoOutputTest.java
@@ -37,7 +37,6 @@ public class RouteNoOutputTest extends ContextTestSupport {
             exception = e;
         }
 
-
     }
 
     @Test
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultCamelContextTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultCamelContextTest.java
index bfe2542da8d..a18335f5e9d 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultCamelContextTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/engine/DefaultCamelContextTest.java
@@ -456,16 +456,6 @@ public class DefaultCamelContextTest extends TestSupport {
         public void setCamelContext(CamelContext camelContext) {
             this.camelContext = camelContext;
         }
-
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
 
 }
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/DataFormatServiceTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/DataFormatServiceTest.java
index 654d6059b95..7292ce34d64 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/DataFormatServiceTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/DataFormatServiceTest.java
@@ -113,16 +113,6 @@ public class DataFormatServiceTest extends ContextTestSupport {
         public Object unmarshal(Exchange exchange, InputStream stream) {
             return "Bye World";
         }
-
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
     // END SNIPPET: e2
 }
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUnmarshalSetHeaderTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUnmarshalSetHeaderTest.java
index 2894cee67e6..2817fa97f37 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUnmarshalSetHeaderTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelUnmarshalSetHeaderTest.java
@@ -69,15 +69,5 @@ public class DeadLetterChannelUnmarshalSetHeaderTest extends ContextTestSupport
         public Object unmarshal(Exchange exchange, InputStream stream) {
             throw new IllegalArgumentException("Damn");
         }
-
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
 }
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/PipelineStepWithEventTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/PipelineStepWithEventTest.java
index d307d448fd3..f8ee035c799 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/PipelineStepWithEventTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/PipelineStepWithEventTest.java
@@ -131,16 +131,6 @@ public class PipelineStepWithEventTest extends ContextTestSupport {
         public List<EventObject> getEvents() {
             return events;
         }
-
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
 
     private static class MyInterceptStrategy implements InterceptStrategy {
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/RouteAwareProcessorTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/RouteAwareProcessorTest.java
index dc2c8a9d21f..66fa899b63f 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/RouteAwareProcessorTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/RouteAwareProcessorTest.java
@@ -79,16 +79,6 @@ public class RouteAwareProcessorTest extends ContextTestSupport {
         public void process(Exchange exchange) {
             exchange.getMessage().setBody("Hello route " + routeId + " from processor " + id);
         }
-
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
 
 }
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/RouteAwareRouteTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/RouteAwareRouteTest.java
index 1aaebfd6f1f..210507e0a6c 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/RouteAwareRouteTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/RouteAwareRouteTest.java
@@ -64,15 +64,5 @@ public class RouteAwareRouteTest extends ContextTestSupport {
         public Route getRoute() {
             return route;
         }
-
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
 }
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/UnmarshalProcessorTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/UnmarshalProcessorTest.java
index 58fbe3487bc..77100c9aaa0 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/UnmarshalProcessorTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/UnmarshalProcessorTest.java
@@ -122,16 +122,6 @@ public class UnmarshalProcessorTest extends TestSupport {
         public Object unmarshal(Exchange exchange, InputStream stream) {
             return object;
         }
-
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
 
 }
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregationStrategyLifecycleTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregationStrategyLifecycleTest.java
index ac5a5a931f5..e59c603a8f9 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregationStrategyLifecycleTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregationStrategyLifecycleTest.java
@@ -95,10 +95,5 @@ public class AggregationStrategyLifecycleTest extends ContextTestSupport {
 
             separator = "+";
         }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
 }
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointEventNotifierSendingTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointEventNotifierSendingTest.java
index 51340a290e9..c141c1ba30e 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointEventNotifierSendingTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointEventNotifierSendingTest.java
@@ -68,10 +68,6 @@ public class AsyncEndpointEventNotifierSendingTest extends ContextTestSupport {
             public boolean isEnabled(CamelEvent event) {
                 return event instanceof ExchangeSendingEvent || event instanceof ExchangeSentEvent;
             }
-
-            @Override
-            protected void doStart() {
-            }
         });
         return context;
     }
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/ErrorHandlerSupportTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/ErrorHandlerSupportTest.java
index d05d40e7671..9e2232f2ceb 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/ErrorHandlerSupportTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/ErrorHandlerSupportTest.java
@@ -98,14 +98,6 @@ public class ErrorHandlerSupportTest extends ContextTestSupport {
 
     private static class ShuntErrorHandlerSupport extends ErrorHandlerSupport {
 
-        @Override
-        protected void doStart() {
-        }
-
-        @Override
-        protected void doStop() {
-        }
-
         @Override
         public boolean supportTransacted() {
             return false;
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/SequenceTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/SequenceTest.java
index 105d54a90b1..cb60a9acb71 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/SequenceTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/SequenceTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.processor.resequencer;
 
-import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
@@ -42,10 +41,6 @@ public class SequenceTest {
         set.add(e2);
     }
 
-    @AfterEach
-    public void tearDown() {
-    }
-
     @Test
     public void testPredecessor() {
         assertEquals(e1, set.predecessor(e2));
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/TestComparatorTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/TestComparatorTest.java
index 1fc65edf7bd..f29fcb5ccf1 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/TestComparatorTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/resequencer/TestComparatorTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.processor.resequencer;
 
-import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
@@ -40,10 +39,6 @@ public class TestComparatorTest {
         e3 = new TestObject(7);
     }
 
-    @AfterEach
-    public void tearDown() {
-    }
-
     @Test
     public void testPredecessor() {
         assertTrue(c.predecessor(e1, e2));
diff --git a/core/camel-core/src/test/java/org/apache/camel/support/ServiceSupportTest.java b/core/camel-core/src/test/java/org/apache/camel/support/ServiceSupportTest.java
index 767a06eee7c..7f0e8a393f6 100644
--- a/core/camel-core/src/test/java/org/apache/camel/support/ServiceSupportTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/support/ServiceSupportTest.java
@@ -25,14 +25,6 @@ import static org.junit.jupiter.api.Assertions.*;
 public class ServiceSupportTest extends TestSupport {
 
     private static class MyService extends ServiceSupport {
-
-        @Override
-        protected void doStart() {
-        }
-
-        @Override
-        protected void doStop() {
-        }
     }
 
     @Test
@@ -78,14 +70,6 @@ public class ServiceSupportTest extends TestSupport {
 
         private boolean shutdown;
 
-        @Override
-        protected void doStart() {
-        }
-
-        @Override
-        protected void doStop() {
-        }
-
         @Override
         protected void doShutdown() {
             shutdown = true;
@@ -167,10 +151,5 @@ public class ServiceSupportTest extends TestSupport {
         protected void doStart() {
             throw new RuntimeException("This service throws an exception when starting");
         }
-
-        @Override
-        protected void doStop() {
-        }
-
     }
 }
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/EventHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/util/EventHelperTest.java
index cb0b928b8db..ef62db89e7f 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/EventHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/EventHelperTest.java
@@ -139,13 +139,5 @@ public class EventHelperTest {
         public boolean isEnabled(CamelEvent event) {
             return true;
         }
-
-        @Override
-        protected void doStart() {
-        }
-
-        @Override
-        protected void doStop() {
-        }
     }
 }
diff --git a/core/camel-management/src/test/java/org/apache/camel/management/ManagedCustomProcessorTest.java b/core/camel-management/src/test/java/org/apache/camel/management/ManagedCustomProcessorTest.java
index c53c30f56d2..2dab3a20088 100644
--- a/core/camel-management/src/test/java/org/apache/camel/management/ManagedCustomProcessorTest.java
+++ b/core/camel-management/src/test/java/org/apache/camel/management/ManagedCustomProcessorTest.java
@@ -94,16 +94,6 @@ public class ManagedCustomProcessorTest extends ManagementTestSupport {
         public void process(Exchange exchange) {
             exchange.getIn().setHeader("foo", getFoo());
         }
-
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
     // end::e1[]
 
diff --git a/core/camel-management/src/test/java/org/apache/camel/management/ManagedNonManagedServiceTest.java b/core/camel-management/src/test/java/org/apache/camel/management/ManagedNonManagedServiceTest.java
index 5bfe03f74fa..1f7e4e722cb 100644
--- a/core/camel-management/src/test/java/org/apache/camel/management/ManagedNonManagedServiceTest.java
+++ b/core/camel-management/src/test/java/org/apache/camel/management/ManagedNonManagedServiceTest.java
@@ -85,28 +85,10 @@ public class ManagedNonManagedServiceTest extends ManagementTestSupport {
 
     private static final class MyService extends ServiceSupport {
 
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
 
     private static final class MyNonService extends ServiceSupport implements NonManagedService {
 
-        @Override
-        protected void doStart() {
-            // noop
-        }
-
-        @Override
-        protected void doStop() {
-            // noop
-        }
     }
 
 }


(camel) 05/05: (chores) camel-core: removed likely incorrect performance tests

Posted by or...@apache.org.
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 00f756c039cf505431b5531a7cf6ac58f7f0259f
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Apr 22 14:01:59 2024 +0200

    (chores) camel-core: removed likely incorrect performance tests
---
 .../impl/TypeConverterRegistryPerformanceTest.java |  79 ----------
 ...irIteratorSplitChoicePerformanceManualTest.java | 174 --------------------
 .../XPathSplitChoicePerformanceManualTest.java     | 175 ---------------------
 3 files changed, 428 deletions(-)

diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/TypeConverterRegistryPerformanceTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/TypeConverterRegistryPerformanceTest.java
deleted file mode 100644
index 089315d0e9f..00000000000
--- a/core/camel-core/src/test/java/org/apache/camel/impl/TypeConverterRegistryPerformanceTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.impl;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import org.w3c.dom.Document;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.util.StopWatch;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class TypeConverterRegistryPerformanceTest extends ContextTestSupport {
-
-    private final int inner = 10;
-
-    private CountDownLatch latch;
-
-    @Test
-    public void testManual() {
-        // noop
-    }
-
-    public void disbledtestPerformance() throws Exception {
-        // force converter to be loaded on startup
-        Document dom = context.getTypeConverter().convertTo(Document.class, "<hello>World</hello>");
-        assertNotNull(dom);
-
-        StopWatch watch = new StopWatch();
-
-        int size = 20000;
-        latch = new CountDownLatch(size);
-        int pool = 100;
-        ExecutorService executorService = Executors.newFixedThreadPool(pool);
-
-        for (int i = 0; i < size; i++) {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    for (int j = 0; j < inner; j++) {
-                        Document dom = context.getTypeConverter().convertTo(Document.class, "<hello>World</hello>");
-                        assertNotNull(dom);
-                    }
-                    latch.countDown();
-                }
-            });
-        }
-
-        assertTrue(latch.await(2, TimeUnit.MINUTES), "Should all work");
-        log.info("Took {}", watch.taken());
-
-        executorService.shutdownNow();
-    }
-
-    @Override
-    public boolean isUseRouteBuilder() {
-        return false;
-    }
-}
diff --git a/core/camel-core/src/test/java/org/apache/camel/language/TokenPairIteratorSplitChoicePerformanceManualTest.java b/core/camel-core/src/test/java/org/apache/camel/language/TokenPairIteratorSplitChoicePerformanceManualTest.java
deleted file mode 100644
index e43a5a0a64b..00000000000
--- a/core/camel-core/src/test/java/org/apache/camel/language/TokenPairIteratorSplitChoicePerformanceManualTest.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.language;
-
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.util.StopWatch;
-import org.apache.camel.util.TimeUtils;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.slf4j.Logger;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-/**
- *
- */
-@Disabled("Test manually")
-public class TokenPairIteratorSplitChoicePerformanceManualTest extends ContextTestSupport {
-
-    private final int size = 20 * 1000;
-    private final AtomicInteger tiny = new AtomicInteger();
-    private final AtomicInteger small = new AtomicInteger();
-    private final AtomicInteger med = new AtomicInteger();
-    private final AtomicInteger large = new AtomicInteger();
-    private final StopWatch watch = new StopWatch();
-
-    @Override
-    @BeforeEach
-    public void setUp() throws Exception {
-        super.setUp();
-        createDataFile(log, size);
-    }
-
-    @Test
-    public void testTokenPairPerformanceRoute() {
-        NotifyBuilder notify = new NotifyBuilder(context).whenDone(size).create();
-
-        boolean matches = notify.matches(5, TimeUnit.MINUTES);
-        log.info("Processed file with {} elements in: {}", size, TimeUtils.printDuration(watch.taken(), true));
-
-        log.info("Processed {} tiny messages", tiny.get());
-        log.info("Processed {} small messages", small.get());
-        log.info("Processed {} medium messages", med.get());
-        log.info("Processed {} large messages", large.get());
-
-        assertEquals((size / 10) * 4, tiny.get());
-        assertEquals((size / 10) * 2, small.get());
-        assertEquals((size / 10) * 3, med.get());
-        assertEquals(size / 10, large.get());
-
-        assertTrue(matches, "Should complete route");
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() {
-        return new RouteBuilder() {
-            @Override
-            public void configure() {
-                from(fileUri("?initialDelay=0&delay=10&noop=true")).process(new Processor() {
-                    public void process(Exchange exchange) {
-                        log.info("Starting to process file");
-                        watch.restart();
-                    }
-                }).split().tokenizeXML("order").streaming().choice().when().xpath("/order/amount < 10")
-                        .process(new Processor() {
-                            public void process(Exchange exchange) {
-                                String xml = exchange.getIn().getBody(String.class);
-                                assertTrue(xml.contains("<amount>3</amount>"), xml);
-
-                                int num = tiny.incrementAndGet();
-                                if (num % 100 == 0) {
-                                    log.info("Processed {} tiny messages", num);
-                                    log.debug(xml);
-                                }
-                            }
-                        }).when().xpath("/order/amount < 50").process(new Processor() {
-                            public void process(Exchange exchange) {
-                                String xml = exchange.getIn().getBody(String.class);
-                                assertTrue(xml.contains("<amount>44</amount>"), xml);
-
-                                int num = small.incrementAndGet();
-                                if (num % 100 == 0) {
-                                    log.info("Processed {} small messages: {}", num, xml);
-                                    log.debug(xml);
-                                }
-                            }
-                        }).when().xpath("/order/amount < 100").process(new Processor() {
-                            public void process(Exchange exchange) {
-                                String xml = exchange.getIn().getBody(String.class);
-                                assertTrue(xml.contains("<amount>88</amount>"), xml);
-
-                                int num = med.incrementAndGet();
-                                if (num % 100 == 0) {
-                                    log.info("Processed {} medium messages", num);
-                                    log.debug(xml);
-                                }
-                            }
-                        }).otherwise().process(new Processor() {
-                            public void process(Exchange exchange) {
-                                String xml = exchange.getIn().getBody(String.class);
-                                assertTrue(xml.contains("<amount>123</amount>"), xml);
-
-                                int num = large.incrementAndGet();
-                                if (num % 100 == 0) {
-                                    log.info("Processed {} large messages", num);
-                                    log.debug(xml);
-                                }
-                            }
-                        }).end() // choice
-                        .end(); // split
-            }
-        };
-    }
-
-    public void createDataFile(Logger log, int size) throws Exception {
-        log.info("Creating data file ...");
-
-        try (OutputStream fos = Files.newOutputStream(testFile("data.xml"))) {
-            fos.write("<orders>\n".getBytes());
-
-            for (int i = 0; i < size; i++) {
-                fos.write("<order>\n".getBytes());
-                fos.write(("  <id>" + i + "</id>\n").getBytes());
-                int num = i % 10;
-                if (num <= 3) {
-                    fos.write("  <amount>3</amount>\n".getBytes());
-                    fos.write("  <customerId>333</customerId>\n".getBytes());
-                } else if (num <= 5) {
-                    fos.write("  <amount>44</amount>\n".getBytes());
-                    fos.write("  <customerId>444</customerId>\n".getBytes());
-                } else if (num <= 8) {
-                    fos.write("  <amount>88</amount>\n".getBytes());
-                    fos.write("  <customerId>888</customerId>\n".getBytes());
-                } else {
-                    fos.write("  <amount>123</amount>\n".getBytes());
-                    fos.write("  <customerId>123123</customerId>\n".getBytes());
-                }
-                fos.write("  <description>bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla</description>\n"
-                        .getBytes());
-                fos.write("</order>\n".getBytes());
-            }
-
-            fos.write("</orders>".getBytes());
-        }
-
-        log.info("Creating data file done.");
-    }
-
-}
diff --git a/core/camel-core/src/test/java/org/apache/camel/language/XPathSplitChoicePerformanceManualTest.java b/core/camel-core/src/test/java/org/apache/camel/language/XPathSplitChoicePerformanceManualTest.java
deleted file mode 100644
index 65045598db5..00000000000
--- a/core/camel-core/src/test/java/org/apache/camel/language/XPathSplitChoicePerformanceManualTest.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.language;
-
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.util.StopWatch;
-import org.apache.camel.util.TimeUtils;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.slf4j.Logger;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-/**
- *
- */
-@Disabled("Test manually")
-public class XPathSplitChoicePerformanceManualTest extends ContextTestSupport {
-
-    private final int size = 20 * 1000;
-    private final AtomicInteger tiny = new AtomicInteger();
-    private final AtomicInteger small = new AtomicInteger();
-    private final AtomicInteger med = new AtomicInteger();
-    private final AtomicInteger large = new AtomicInteger();
-    private final StopWatch watch = new StopWatch();
-
-    @Override
-    @BeforeEach
-    public void setUp() throws Exception {
-        super.setUp();
-        createDataFile(log, size);
-    }
-
-    @Test
-    public void testXPatPerformanceRoute() {
-        NotifyBuilder notify = new NotifyBuilder(context).whenDone(size).create();
-
-        boolean matches = notify.matches(60, TimeUnit.SECONDS);
-        log.info("Processed file with {} elements in: {}", size, TimeUtils.printDuration(watch.taken(), true));
-
-        log.info("Processed {} tiny messages", tiny.get());
-        log.info("Processed {} small messages", small.get());
-        log.info("Processed {} medium messages", med.get());
-        log.info("Processed {} large messages", large.get());
-
-        assertEquals((size / 10) * 4, tiny.get());
-        assertEquals((size / 10) * 2, small.get());
-        assertEquals((size / 10) * 3, med.get());
-        assertEquals(size / 10, large.get());
-
-        assertTrue(matches, "Should complete route");
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() {
-        return new RouteBuilder() {
-            @Override
-            public void configure() {
-                from(fileUri("?initialDelay=0&delay=10&noop=true")).process(new Processor() {
-                    public void process(Exchange exchange) {
-                        log.info("Starting to process file");
-                        watch.restart();
-                    }
-                }).split().xpath("/orders/order").streaming().choice().when().xpath("/order/amount < 10")
-                        .process(new Processor() {
-                            public void process(Exchange exchange) {
-                                String xml = exchange.getIn().getBody(String.class);
-                                assertTrue(xml.contains("<amount>3</amount>"), xml);
-
-                                int num = tiny.incrementAndGet();
-                                if (num % 100 == 0) {
-                                    log.info("Processed {} tiny messages", num);
-                                    log.debug(xml);
-                                }
-                            }
-                        }).when().xpath("/order/amount < 50").process(new Processor() {
-                            public void process(Exchange exchange) {
-                                String xml = exchange.getIn().getBody(String.class);
-                                assertTrue(xml.contains("<amount>44</amount>"), xml);
-
-                                int num = small.incrementAndGet();
-                                if (num % 100 == 0) {
-                                    log.info("Processed {} small messages", num);
-                                    log.debug(xml);
-                                }
-                            }
-                        }).when().xpath("/order/amount < 100").process(new Processor() {
-                            public void process(Exchange exchange) {
-                                String xml = exchange.getIn().getBody(String.class);
-                                assertTrue(xml.contains("<amount>88</amount>"), xml);
-
-                                int num = med.incrementAndGet();
-                                if (num % 100 == 0) {
-                                    log.info("Processed {} medium messages", num);
-                                    log.debug(xml);
-                                }
-                            }
-                        }).otherwise().process(new Processor() {
-                            public void process(Exchange exchange) {
-                                String xml = exchange.getIn().getBody(String.class);
-                                assertTrue(xml.contains("<amount>123</amount>"), xml);
-
-                                int num = large.incrementAndGet();
-                                if (num % 100 == 0) {
-                                    log.info("Processed {} large messages", num);
-                                    log.debug(xml);
-                                }
-                            }
-                        }).end() // choice
-                        .end(); // split
-            }
-        };
-    }
-
-    public void createDataFile(Logger log, int size) throws Exception {
-
-        log.info("Creating data file ...");
-
-        try (OutputStream fos = Files.newOutputStream(testFile("data.xml"))) {
-            fos.write("<orders>\n".getBytes());
-
-            for (int i = 0; i < size; i++) {
-                fos.write("<order>\n".getBytes());
-                fos.write(("  <id>" + i + "</id>\n").getBytes());
-                int num = i % 10;
-                if (num <= 3) {
-                    fos.write("  <amount>3</amount>\n".getBytes());
-                    fos.write("  <customerId>333</customerId>\n".getBytes());
-                } else if (num <= 5) {
-                    fos.write("  <amount>44</amount>\n".getBytes());
-                    fos.write("  <customerId>444</customerId>\n".getBytes());
-                } else if (num <= 8) {
-                    fos.write("  <amount>88</amount>\n".getBytes());
-                    fos.write("  <customerId>888</customerId>\n".getBytes());
-                } else {
-                    fos.write("  <amount>123</amount>\n".getBytes());
-                    fos.write("  <customerId>123123</customerId>\n".getBytes());
-                }
-                fos.write("  <description>bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla</description>\n"
-                        .getBytes());
-                fos.write("</order>\n".getBytes());
-            }
-
-            fos.write("</orders>".getBytes());
-        }
-
-        log.info("Creating data file done.");
-    }
-
-}


(camel) 04/05: (chores) camel-core: added unused suppressions to methods used indirectly

Posted by or...@apache.org.
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 675a527618aaf19ad7ca94387506c43a2bd2203c
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Apr 22 13:54:32 2024 +0200

    (chores) camel-core: added unused suppressions to methods used indirectly
---
 .../test/java/org/apache/camel/component/bean/BeanConcurrentTest.java  | 1 +
 .../org/apache/camel/component/bean/BeanExpressionConcurrentTest.java  | 1 +
 .../camel/component/bean/BeanInfoAMoreComplexOverloadedTest.java       | 1 +
 .../java/org/apache/camel/component/bean/BeanInfoInheritanceTest.java  | 1 +
 .../java/org/apache/camel/component/bean/BeanInfoOverloadedTest.java   | 1 +
 .../camel/component/bean/BeanInfoOverloadedWithSubTypeParamTest.java   | 1 +
 .../src/test/java/org/apache/camel/component/bean/BeanInfoTest.java    | 3 +++
 .../src/test/java/org/apache/camel/component/bean/BeanInvokeTest.java  | 3 +++
 .../test/java/org/apache/camel/component/bean/BeanLifecycleTest.java   | 1 +
 .../camel/component/bean/issues/BeanThisAdviceWithIssueTest.java       | 1 +
 .../src/test/java/org/apache/camel/util/ObjectHelperTest.java          | 1 +
 11 files changed, 15 insertions(+)

diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanConcurrentTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanConcurrentTest.java
index 8d85d47ca2d..3316c3cbe48 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanConcurrentTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanConcurrentTest.java
@@ -109,6 +109,7 @@ public class BeanConcurrentTest extends ContextTestSupport {
             this.baz = baz;
         }
 
+        @SuppressWarnings("unused")
         public void doSomething() {
             // noop
         }
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanExpressionConcurrentTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanExpressionConcurrentTest.java
index 7f98573d2b6..2670f47be83 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanExpressionConcurrentTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanExpressionConcurrentTest.java
@@ -110,6 +110,7 @@ public class BeanExpressionConcurrentTest extends ContextTestSupport {
             this.baz = baz;
         }
 
+        @SuppressWarnings("unused")
         public void doSomething() {
             // noop
         }
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoAMoreComplexOverloadedTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoAMoreComplexOverloadedTest.java
index b6f6697ae07..eabcd65ce09 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoAMoreComplexOverloadedTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoAMoreComplexOverloadedTest.java
@@ -79,6 +79,7 @@ public class BeanInfoAMoreComplexOverloadedTest extends ContextTestSupport {
         assertEquals(2, e.getMethods().size());
     }
 
+    @SuppressWarnings("Unused")
     static class Bean {
         public void doSomething(RequestA request) {
         }
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoInheritanceTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoInheritanceTest.java
index 440930fc361..4fe993fa761 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoInheritanceTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoInheritanceTest.java
@@ -102,6 +102,7 @@ public class BeanInfoInheritanceTest extends ContextTestSupport {
         }
     }
 
+    @SuppressWarnings("Unused")
     public static class A {
 
         public void doSomething(String body) {
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedTest.java
index a337a54035d..440bb0a029e 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedTest.java
@@ -46,6 +46,7 @@ public class BeanInfoOverloadedTest extends ContextTestSupport {
         assertEquals(RequestB.class, method.getGenericParameterTypes()[0]);
     }
 
+    @SuppressWarnings("Unused")
     static class Bean {
         public void doSomething(RequestA request) {
         }
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedWithSubTypeParamTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedWithSubTypeParamTest.java
index a1213242a03..0bfa1b8152a 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedWithSubTypeParamTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoOverloadedWithSubTypeParamTest.java
@@ -29,6 +29,7 @@ public class BeanInfoOverloadedWithSubTypeParamTest extends ContextTestSupport {
         assertEquals(2, beanInfo.getMethods().size());
     }
 
+    @SuppressWarnings("Unused")
     static class Bean {
 
         public void doSomething(RequestB request) {
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoTest.java
index a7a5573a280..2d7433f60fd 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoTest.java
@@ -166,13 +166,16 @@ public class BeanInfoTest {
 
     @InOnly
     public interface MyOneWayInterface {
+        @SuppressWarnings("Unused")
         void inOnlyMethod();
     }
 
     @InOnly
     public interface MyOneWayInterfaceWithOverloadedMethod {
+        @SuppressWarnings("Unused")
         void inOnlyMethod();
 
+        @SuppressWarnings("Unused")
         @InOut
         Object inOutMethod();
     }
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInvokeTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInvokeTest.java
index 89f8ba38082..d06ad759bb5 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInvokeTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanInvokeTest.java
@@ -96,10 +96,12 @@ public class BeanInvokeTest extends ContextTestSupport {
         };
     }
 
+    @SuppressWarnings("Unused")
     public String doSomething(String s) {
         return s;
     }
 
+    @SuppressWarnings("Unused")
     public String changeSomething(String s) {
         if ("Hello World".equals(s)) {
             return "Bye World";
@@ -107,6 +109,7 @@ public class BeanInvokeTest extends ContextTestSupport {
         return null;
     }
 
+    @SuppressWarnings("Unused")
     public void doNothing(String s) {
     }
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanLifecycleTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanLifecycleTest.java
index dea02f5c8a1..aa4829d0d42 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanLifecycleTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/BeanLifecycleTest.java
@@ -97,6 +97,7 @@ public class BeanLifecycleTest extends ContextTestSupport {
         };
     }
 
+    @SuppressWarnings("Unused")
     public static class MyBean implements Service {
         private String status;
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bean/issues/BeanThisAdviceWithIssueTest.java b/core/camel-core/src/test/java/org/apache/camel/component/bean/issues/BeanThisAdviceWithIssueTest.java
index 46f77a19d80..27d41e8b964 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bean/issues/BeanThisAdviceWithIssueTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bean/issues/BeanThisAdviceWithIssueTest.java
@@ -42,6 +42,7 @@ public class BeanThisAdviceWithIssueTest extends ContextTestSupport {
                 from("direct:mytest").id(ROUTE_ID).bean(this, "hello", BeanScope.Prototype).to("log:out");
             }
 
+            @SuppressWarnings("Unused")
             public void hello(final Exchange exchange) {
             }
         });
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/ObjectHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/util/ObjectHelperTest.java
index ce3cf724fc5..e2163f2baa1 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/ObjectHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/ObjectHelperTest.java
@@ -98,6 +98,7 @@ public class ObjectHelperTest {
         assertEquals("cheese", name, "Property name");
     }
 
+    @SuppressWarnings("Unused")
     public void setCheese(String cheese) {
         // used in the above unit test
     }


(camel) 02/05: (chores) camel-core: fix incorrect test without assertions

Posted by or...@apache.org.
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 6d5fa67ebe9f0fde78d4e14b32053ec2e502b2a3
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Apr 22 13:32:51 2024 +0200

    (chores) camel-core: fix incorrect test without assertions
---
 .../org/apache/camel/impl/RouteNoOutputTest.java   | 23 +++++++++++++---------
 .../CreateRouteWithNonExistingEndpointTest.java    | 10 ++++++----
 ...RouteWithConstantFieldFromExchangeFailTest.java | 11 ++++++-----
 3 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/RouteNoOutputTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/RouteNoOutputTest.java
index 2a6e7d47586..5163b71c6b1 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/RouteNoOutputTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/RouteNoOutputTest.java
@@ -19,31 +19,36 @@ package org.apache.camel.impl;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.FailedToCreateRouteException;
 import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
-import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class RouteNoOutputTest extends ContextTestSupport {
+    private Exception exception;
 
     @Override
     @BeforeEach
     public void setUp() {
+        try {
+            super.setUp();
+        } catch (Exception e) {
+            exception = e;
+        }
 
-        Exception e = assertThrows(Exception.class, super::setUp,
-                "Should have thrown exception");
 
-        FailedToCreateRouteException failed = assertIsInstanceOf(FailedToCreateRouteException.class, e);
-        assertTrue(failed.getRouteId().matches("route[0-9]+"));
-        assertIsInstanceOf(IllegalArgumentException.class, e.getCause());
-        assertTrue(e.getCause().getMessage().matches(
-                "Route route[0-9]+\\Q has no output processors. You need to add outputs to the route such as to(\"log:foo\").\\E"));
     }
 
     @Test
     public void testDummy() {
-        // noop
+        Assertions.assertNotNull(exception, "Should have thrown exception");
+
+        FailedToCreateRouteException failed = assertIsInstanceOf(FailedToCreateRouteException.class, exception);
+        assertTrue(failed.getRouteId().matches("route[0-9]+"));
+        assertIsInstanceOf(IllegalArgumentException.class, exception.getCause());
+        assertTrue(exception.getCause().getMessage().matches(
+                "Route route[0-9]+\\Q has no output processors. You need to add outputs to the route such as to(\"log:foo\").\\E"));
     }
 
     @Override
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/CreateRouteWithNonExistingEndpointTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/CreateRouteWithNonExistingEndpointTest.java
index c73b4c5ca13..0890247943b 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/CreateRouteWithNonExistingEndpointTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/CreateRouteWithNonExistingEndpointTest.java
@@ -23,12 +23,16 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 public class CreateRouteWithNonExistingEndpointTest extends ContextTestSupport {
+    private Exception exception = null;
 
     @Test
     public void testCreateRouteWithBadEndpoint() {
+        assertNotNull(exception, "Should have failed to create a route to a non-existent endpoint!");
+        NoSuchEndpointException nse = assertIsInstanceOf(NoSuchEndpointException.class, exception.getCause());
+        assertEquals("thisUriDoesNotExist", nse.getUri(), "uri");
     }
 
     @Override
@@ -36,11 +40,9 @@ public class CreateRouteWithNonExistingEndpointTest extends ContextTestSupport {
     public void setUp() {
         try {
             super.setUp();
-            fail("Should have failed to create this route!");
         } catch (Exception e) {
             log.debug("Caught expected exception: {}", e.getMessage(), e);
-            NoSuchEndpointException nse = assertIsInstanceOf(NoSuchEndpointException.class, e.getCause());
-            assertEquals("thisUriDoesNotExist", nse.getUri(), "uri");
+            exception = e;
         }
     }
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/RouteWithConstantFieldFromExchangeFailTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/RouteWithConstantFieldFromExchangeFailTest.java
index 8108acf6498..461440a317b 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/RouteWithConstantFieldFromExchangeFailTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/RouteWithConstantFieldFromExchangeFailTest.java
@@ -22,13 +22,16 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 public class RouteWithConstantFieldFromExchangeFailTest extends ContextTestSupport {
+    private Exception exception;
 
     @Test
     public void testFail() {
-        // noop as its tested that it fails on startup
+        assertNotNull(exception, "Should have thrown an exception");
+        IllegalArgumentException iae = assertIsInstanceOf(IllegalArgumentException.class, exception.getCause());
+        assertEquals("Constant field with name: XXX not found on Exchange.class", iae.getMessage());
     }
 
     @Override
@@ -36,10 +39,8 @@ public class RouteWithConstantFieldFromExchangeFailTest extends ContextTestSuppo
     public void setUp() {
         try {
             super.setUp();
-            fail("Should have thrown an exception");
         } catch (Exception e) {
-            IllegalArgumentException iae = assertIsInstanceOf(IllegalArgumentException.class, e.getCause());
-            assertEquals("Constant field with name: XXX not found on Exchange.class", iae.getMessage());
+            exception = e;
         }
     }