You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/04/06 21:37:32 UTC
[camel] 01/05: CAMEL-13108: Rename test to dataset-test component
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch mock2
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 0afa15be6ea858b51a2ccdf2dc964ae6f316269e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Apr 6 13:55:14 2019 +0200
CAMEL-13108: Rename test to dataset-test component
---
.../DataSetTestComponent.java} | 12 ++++----
.../DataSetTestEndpoint.java} | 8 +++---
.../org/apache/camel/component/test/package.html | 27 ------------------
.../DataSetTestAnyOrderTest.java} | 6 ++--
.../DataSetTestEndpointTest.java} | 6 ++--
.../DataSetTestFileSplitTest.java} | 7 +++--
.../DataSetTestFileTest.java} | 7 +++--
.../DataSetTestSedaTest.java} | 6 ++--
.../DataSetTestComponentAutoConfiguration.java} | 32 +++++++++++-----------
.../DataSetTestComponentConfiguration.java} | 10 +++----
.../src/main/resources/META-INF/spring.factories | 3 +-
11 files changed, 49 insertions(+), 75 deletions(-)
diff --git a/core/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java b/core/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetTestComponent.java
similarity index 82%
rename from core/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java
rename to core/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetTestComponent.java
index 223ccc0..bfbf244 100644
--- a/core/camel-core/src/main/java/org/apache/camel/component/test/TestComponent.java
+++ b/core/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetTestComponent.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.test;
+package org.apache.camel.component.dataset;
import java.util.Map;
@@ -24,21 +24,21 @@ import org.apache.camel.support.DefaultComponent;
import org.apache.camel.util.URISupport;
/**
- * The <a href="http://camel.apache.org/test.html">Test Component</a> is for simplifying unit and integration tests.
+ * The <a href="http://camel.apache.org/test.html">DataSet Test Component</a> is for simplifying unit and integration tests.
*
* Component for testing by polling test messages from another endpoint on startup as the expected message bodies to
* receive during testing.
*/
-@org.apache.camel.spi.annotations.Component("test")
-public class TestComponent extends DefaultComponent {
+@org.apache.camel.spi.annotations.Component("dataset-test")
+public class DataSetTestComponent extends DefaultComponent {
- public TestComponent() {
+ public DataSetTestComponent() {
}
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
Long timeout = getAndRemoveParameter(parameters, "timeout", Long.class);
- TestEndpoint answer = new TestEndpoint(uri, this);
+ DataSetTestEndpoint answer = new DataSetTestEndpoint(uri, this);
if (timeout != null) {
answer.setTimeout(timeout);
}
diff --git a/core/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java b/core/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetTestEndpoint.java
similarity index 93%
rename from core/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
rename to core/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetTestEndpoint.java
index f9563b4..4a20779 100644
--- a/core/camel-core/src/main/java/org/apache/camel/component/test/TestEndpoint.java
+++ b/core/camel-core/src/main/java/org/apache/camel/component/dataset/DataSetTestEndpoint.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.test;
+package org.apache.camel.component.dataset;
import java.util.ArrayList;
import java.util.Iterator;
@@ -42,8 +42,8 @@ import org.apache.camel.support.ObjectHelper;
* This will then set up a properly configured Mock endpoint, which is only valid if the received messages
* match the number of expected messages and their message payloads are equal.
*/
-@UriEndpoint(firstVersion = "1.3.0", scheme = "test", title = "Test", syntax = "test:name", producerOnly = true, label = "core,testing", lenientProperties = true)
-public class TestEndpoint extends MockEndpoint {
+@UriEndpoint(firstVersion = "1.3.0", scheme = "dataset-test", title = "DataSet Test", syntax = "dataset-test:name", producerOnly = true, label = "core,testing", lenientProperties = true)
+public class DataSetTestEndpoint extends MockEndpoint {
private Endpoint expectedMessageEndpoint;
@@ -58,7 +58,7 @@ public class TestEndpoint extends MockEndpoint {
@UriParam
private String delimiter = "\\n|\\r";
- public TestEndpoint(String endpointUri, Component component) {
+ public DataSetTestEndpoint(String endpointUri, Component component) {
super(endpointUri, component);
}
diff --git a/core/camel-core/src/main/java/org/apache/camel/component/test/package.html b/core/camel-core/src/main/java/org/apache/camel/component/test/package.html
deleted file mode 100644
index 7032f35..0000000
--- a/core/camel-core/src/main/java/org/apache/camel/component/test/package.html
+++ /dev/null
@@ -1,27 +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.
-
--->
-<html>
-<head>
-</head>
-<body>
-
-A <a href="http://camel.apache.org/test.html">Test Endpoint</a> for Pattern Based Testing
-
-</body>
-</html>
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/test/TestAnyOrderTest.java b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestAnyOrderTest.java
similarity index 89%
rename from core/camel-core/src/test/java/org/apache/camel/component/test/TestAnyOrderTest.java
rename to core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestAnyOrderTest.java
index 3ef718c..85af448 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/test/TestAnyOrderTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestAnyOrderTest.java
@@ -14,13 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.test;
+package org.apache.camel.component.dataset;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.junit.Test;
-public class TestAnyOrderTest extends ContextTestSupport {
+public class DataSetTestAnyOrderTest extends ContextTestSupport {
@Override
public boolean isUseRouteBuilder() {
@@ -36,7 +36,7 @@ public class TestAnyOrderTest extends ContextTestSupport {
@Override
public void configure() throws Exception {
from("direct:start")
- .to("test:seda:testme?anyOrder=true&timeout=0");
+ .to("dataset-test:seda:testme?anyOrder=true&timeout=0");
}
});
context.start();
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/test/TestEndpointTest.java b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestEndpointTest.java
similarity index 95%
rename from core/camel-core/src/test/java/org/apache/camel/component/test/TestEndpointTest.java
rename to core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestEndpointTest.java
index 72575c9..393369c 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/test/TestEndpointTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestEndpointTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.test;
+package org.apache.camel.component.dataset;
import org.apache.camel.CamelContext;
import org.apache.camel.Consumer;
@@ -31,7 +31,7 @@ import org.junit.Test;
/**
*
*/
-public class TestEndpointTest extends ContextTestSupport {
+public class DataSetTestEndpointTest extends ContextTestSupport {
private String expectedBody = "Hello World";
@@ -52,7 +52,7 @@ public class TestEndpointTest extends ContextTestSupport {
context.addEndpoint("my:foo", my);
from("seda:foo")
- .to("test:my:foo?timeout=0");
+ .to("dataset-test:my:foo?timeout=0");
}
};
}
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/test/TestFileSplitTest.java b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestFileSplitTest.java
similarity index 89%
rename from core/camel-core/src/test/java/org/apache/camel/component/test/TestFileSplitTest.java
rename to core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestFileSplitTest.java
index f36ef50..50f2124 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/test/TestFileSplitTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestFileSplitTest.java
@@ -14,14 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.test;
+package org.apache.camel.component.dataset;
+
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
-public class TestFileSplitTest extends ContextTestSupport {
+public class DataSetTestFileSplitTest extends ContextTestSupport {
@Override
public boolean isUseRouteBuilder() {
@@ -44,7 +45,7 @@ public class TestFileSplitTest extends ContextTestSupport {
@Override
public void configure() throws Exception {
from("direct:start")
- .to("test:file:target/data/testme?noop=true&split=true&timeout=1000");
+ .to("dataset-test:file:target/data/testme?noop=true&split=true&timeout=1000");
}
});
context.start();
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/test/TestFileTest.java b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestFileTest.java
similarity index 89%
rename from core/camel-core/src/test/java/org/apache/camel/component/test/TestFileTest.java
rename to core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestFileTest.java
index e8cec97..b07e667 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/test/TestFileTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestFileTest.java
@@ -14,14 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.test;
+package org.apache.camel.component.dataset;
+
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
-public class TestFileTest extends ContextTestSupport {
+public class DataSetTestFileTest extends ContextTestSupport {
@Override
public boolean isUseRouteBuilder() {
@@ -44,7 +45,7 @@ public class TestFileTest extends ContextTestSupport {
@Override
public void configure() throws Exception {
from("direct:start")
- .to("test:file:target/data/testme?noop=true&timeout=1500");
+ .to("dataset-test:file:target/data/testme?noop=true&timeout=1500");
}
});
context.start();
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/test/TestSedaTest.java b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestSedaTest.java
similarity index 89%
rename from core/camel-core/src/test/java/org/apache/camel/component/test/TestSedaTest.java
rename to core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestSedaTest.java
index a51032e..da1c6d1 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/test/TestSedaTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTestSedaTest.java
@@ -14,13 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.test;
+package org.apache.camel.component.dataset;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.junit.Test;
-public class TestSedaTest extends ContextTestSupport {
+public class DataSetTestSedaTest extends ContextTestSupport {
@Override
public boolean isUseRouteBuilder() {
@@ -35,7 +35,7 @@ public class TestSedaTest extends ContextTestSupport {
@Override
public void configure() throws Exception {
from("direct:start")
- .to("test:seda:testme?timeout=0");
+ .to("dataset-test:seda:testme?timeout=0");
}
});
context.start();
diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/test/springboot/TestComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentAutoConfiguration.java
similarity index 82%
rename from platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/test/springboot/TestComponentAutoConfiguration.java
rename to platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentAutoConfiguration.java
index 67bf4f0..dfff4fb 100644
--- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/test/springboot/TestComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentAutoConfiguration.java
@@ -14,14 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.test.springboot;
+package org.apache.camel.component.dataset.springboot;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import org.apache.camel.CamelContext;
-import org.apache.camel.component.test.TestComponent;
+import org.apache.camel.component.dataset.DataSetTestComponent;
import org.apache.camel.spi.ComponentCustomizer;
import org.apache.camel.spi.HasId;
import org.apache.camel.spring.boot.CamelAutoConfiguration;
@@ -51,34 +51,34 @@ import org.springframework.context.annotation.Lazy;
@Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo")
@Configuration
@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class,
- TestComponentAutoConfiguration.GroupConditions.class})
+ DataSetTestComponentAutoConfiguration.GroupConditions.class})
@AutoConfigureAfter(CamelAutoConfiguration.class)
@EnableConfigurationProperties({ComponentConfigurationProperties.class,
- TestComponentConfiguration.class})
-public class TestComponentAutoConfiguration {
+ DataSetTestComponentConfiguration.class})
+public class DataSetTestComponentAutoConfiguration {
private static final Logger LOGGER = LoggerFactory
- .getLogger(TestComponentAutoConfiguration.class);
+ .getLogger(DataSetTestComponentAutoConfiguration.class);
@Autowired
private ApplicationContext applicationContext;
@Autowired
private CamelContext camelContext;
@Autowired
- private TestComponentConfiguration configuration;
+ private DataSetTestComponentConfiguration configuration;
@Autowired(required = false)
- private List<ComponentCustomizer<TestComponent>> customizers;
+ private List<ComponentCustomizer<DataSetTestComponent>> customizers;
static class GroupConditions extends GroupCondition {
public GroupConditions() {
- super("camel.component", "camel.component.test");
+ super("camel.component", "camel.component.dataset-test");
}
}
@Lazy
- @Bean(name = "test-component")
- @ConditionalOnMissingBean(TestComponent.class)
- public TestComponent configureTestComponent() throws Exception {
- TestComponent component = new TestComponent();
+ @Bean(name = "dataset-test-component")
+ @ConditionalOnMissingBean(DataSetTestComponent.class)
+ public DataSetTestComponent configureDataSetTestComponent() throws Exception {
+ DataSetTestComponent component = new DataSetTestComponent();
component.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null,
@@ -105,17 +105,17 @@ public class TestComponentAutoConfiguration {
CamelPropertiesHelper.setCamelProperties(camelContext, component,
parameters, false);
if (ObjectHelper.isNotEmpty(customizers)) {
- for (ComponentCustomizer<TestComponent> customizer : customizers) {
+ for (ComponentCustomizer<DataSetTestComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId)
? HierarchicalPropertiesEvaluator.evaluate(
applicationContext.getEnvironment(),
"camel.component.customizer",
- "camel.component.test.customizer",
+ "camel.component.dataset-test.customizer",
((HasId) customizer).getId())
: HierarchicalPropertiesEvaluator.evaluate(
applicationContext.getEnvironment(),
"camel.component.customizer",
- "camel.component.test.customizer");
+ "camel.component.dataset-test.customizer");
if (useCustomizer) {
LOGGER.debug("Configure component {}, with customizer {}",
component, customizer);
diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/test/springboot/TestComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentConfiguration.java
similarity index 87%
rename from platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/test/springboot/TestComponentConfiguration.java
rename to platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentConfiguration.java
index 406fee9..efc1eff 100644
--- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/test/springboot/TestComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentConfiguration.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.test.springboot;
+package org.apache.camel.component.dataset.springboot;
import javax.annotation.Generated;
import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
@@ -27,14 +27,14 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo")
-@ConfigurationProperties(prefix = "camel.component.test")
-public class TestComponentConfiguration
+@ConfigurationProperties(prefix = "camel.component.dataset-test")
+public class DataSetTestComponentConfiguration
extends
ComponentConfigurationPropertiesCommon {
/**
- * Whether to enable auto configuration of the test component. This is
- * enabled by default.
+ * Whether to enable auto configuration of the dataset-test component. This
+ * is enabled by default.
*/
private Boolean enabled;
/**
diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories b/platforms/spring-boot/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories
index 2ab3db9..684b6a0 100644
--- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories
+++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories
@@ -18,8 +18,8 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.apache.camel.component.bean.springboot.BeanComponentAutoConfiguration,\
org.apache.camel.component.beanclass.springboot.ClassComponentAutoConfiguration,\
org.apache.camel.component.dataset.springboot.DataSetComponentAutoConfiguration,\
+org.apache.camel.component.dataset.springboot.DataSetTestComponentAutoConfiguration,\
org.apache.camel.component.mock.springboot.MockComponentAutoConfiguration,\
-org.apache.camel.component.test.springboot.TestComponentAutoConfiguration,\
org.apache.camel.impl.springboot.GzipDataFormatAutoConfiguration,\
org.apache.camel.impl.springboot.SerializationDataFormatAutoConfiguration,\
org.apache.camel.impl.springboot.StringDataFormatAutoConfiguration,\
@@ -35,4 +35,3 @@ org.apache.camel.language.tokenizer.springboot.TokenizeLanguageAutoConfiguration
org.apache.camel.language.tokenizer.springboot.XMLTokenizeLanguageAutoConfiguration,\
org.apache.camel.language.xpath.springboot.XPathLanguageAutoConfiguration,\
org.apache.camel.model.rest.springboot.RestConfigurationDefinitionAutoConfiguration
-