essobedo commented on code in PR #409: URL: https://github.com/apache/camel-karaf/pull/409#discussion_r1670376606
########## tooling/camel-karaf-test-feature-archetype/pom.xml: ########## @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.karaf</groupId> + <artifactId>tooling</artifactId> + <version>4.6.0-SNAPSHOT</version> + </parent> + + <artifactId>camel-karaf-test-feature-archetype</artifactId> + + <properties> + <maven.archetype.version>3.2.1</maven.archetype.version> Review Comment: Let's apply the naming convention for plugins so it should rather be `maven-archetype-plugin-version` ########## tooling/camel-karaf-test-feature-archetype/pom.xml: ########## @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> Review Comment: License is missing ########## tooling/camel-karaf-test-feature-archetype/README.md: ########## @@ -0,0 +1,17 @@ +# Apache Camel Karaf Archetype + +### Introduction + +This archetype is to initialize a maven project to test a camel-feature inside karaf using the +org.apache.camel.karaf:camel-integration-test Review Comment: What does it represent exactly? ########## tooling/camel-karaf-test-feature-archetype/src/main/resources/archetype-resources/src/main/java/test/Camel__featureName__RouteSupplier.java: ########## @@ -0,0 +1,57 @@ +/* + * 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.karaf.camel.test; + +import static org.apache.camel.builder.Builder.constant; + +import java.util.function.Function; +import org.apache.camel.CamelContext; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.model.RouteDefinition; +import org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteSupplier; +import org.osgi.service.component.annotations.Component; + + +@Component( + name = "karaf-camel-${featureNameLower}-test", + immediate = true, + service = Camel${featureName}RouteSupplier.class +) +public class Camel${featureName}RouteSupplier extends AbstractCamelSingleFeatureResultMockBasedRouteSupplier { + + + @Override + public void configure(CamelContext context) { + + } Review Comment: Should be commented by default as it is not always needed ########## tooling/camel-karaf-test-feature-archetype/src/main/resources/archetype-resources/src/main/java/test/Camel__featureName__RouteSupplier.java: ########## @@ -0,0 +1,57 @@ +/* + * 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.karaf.camel.test; + +import static org.apache.camel.builder.Builder.constant; + +import java.util.function.Function; +import org.apache.camel.CamelContext; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.model.RouteDefinition; +import org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteSupplier; +import org.osgi.service.component.annotations.Component; + + Review Comment: ```suggestion ``` ########## tooling/camel-karaf-test-feature-archetype/README.md: ########## @@ -0,0 +1,17 @@ +# Apache Camel Karaf Archetype Review Comment: Should reflect that it is only for the integration tests ########## tooling/camel-karaf-test-feature-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml: ########## @@ -0,0 +1,25 @@ +<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0"> Review Comment: License is missing ########## tooling/camel-karaf-test-feature-archetype/README.md: ########## @@ -0,0 +1,17 @@ +# Apache Camel Karaf Archetype + +### Introduction + +This archetype is to initialize a maven project to test a camel-feature inside karaf using the Review Comment: I find it a bit confusing/misleading. I would expect something like `This archetype is to initialize a maven project to write an integration test for a Camel Karaf feature using the...` ########## tooling/camel-karaf-test-feature-archetype/README.md: ########## @@ -0,0 +1,17 @@ +# Apache Camel Karaf Archetype + +### Introduction + +This archetype is to initialize a maven project to test a camel-feature inside karaf using the +org.apache.camel.karaf:camel-integration-test + +### Usage + +This tool is using maven archetype:generate plugin, for instance, to +initialize a test for camel-Atom , go to camel-karaf/tests/features/ , run Review Comment: ```suggestion initialize an integration test for the component camel-atom, go to `camel-karaf/tests/features/`, then run ``` ########## tooling/camel-karaf-test-feature-archetype/src/main/resources/archetype-resources/src/main/java/test/Camel__featureName__RouteSupplier.java: ########## @@ -0,0 +1,57 @@ +/* + * 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.karaf.camel.test; + +import static org.apache.camel.builder.Builder.constant; + +import java.util.function.Function; +import org.apache.camel.CamelContext; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.model.RouteDefinition; +import org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteSupplier; +import org.osgi.service.component.annotations.Component; + + +@Component( + name = "karaf-camel-${featureNameLower}-test", + immediate = true, + service = Camel${featureName}RouteSupplier.class +) +public class Camel${featureName}RouteSupplier extends AbstractCamelSingleFeatureResultMockBasedRouteSupplier { + + + @Override + public void configure(CamelContext context) { + + } + + Review Comment: ```suggestion ``` ########## tooling/camel-karaf-test-feature-archetype/src/main/resources/archetype-resources/src/main/java/test/Camel__featureName__RouteSupplier.java: ########## @@ -0,0 +1,57 @@ +/* + * 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.karaf.camel.test; + +import static org.apache.camel.builder.Builder.constant; + +import java.util.function.Function; +import org.apache.camel.CamelContext; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.model.RouteDefinition; +import org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteSupplier; +import org.osgi.service.component.annotations.Component; + + +@Component( + name = "karaf-camel-${featureNameLower}-test", + immediate = true, + service = Camel${featureName}RouteSupplier.class +) +public class Camel${featureName}RouteSupplier extends AbstractCamelSingleFeatureResultMockBasedRouteSupplier { + + + @Override + public void configure(CamelContext context) { + + } + + + @Override + protected Function<RouteBuilder, RouteDefinition> consumerRoute() { + return builder -> + builder.from("${featureNameLower}://") + .log("received message ${body}") + .setBody(constant("OK")); + } + + @Override + protected void configureProducer(RouteBuilder builder, RouteDefinition producerRoute) { + + } + + Review Comment: ```suggestion ``` ########## tooling/camel-karaf-test-feature-archetype/src/main/resources/archetype-resources/src/main/java/test/Camel__featureName__RouteSupplier.java: ########## @@ -0,0 +1,57 @@ +/* + * 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.karaf.camel.test; + +import static org.apache.camel.builder.Builder.constant; + +import java.util.function.Function; +import org.apache.camel.CamelContext; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.model.RouteDefinition; +import org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteSupplier; +import org.osgi.service.component.annotations.Component; + + +@Component( + name = "karaf-camel-${featureNameLower}-test", + immediate = true, + service = Camel${featureName}RouteSupplier.class +) +public class Camel${featureName}RouteSupplier extends AbstractCamelSingleFeatureResultMockBasedRouteSupplier { + + Review Comment: ```suggestion ``` ########## tooling/camel-karaf-test-feature-archetype/src/main/resources/archetype-resources/pom.xml: ########## @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.karaf</groupId> + <artifactId>camel-karaf-features-test</artifactId> + <version>${version}</version> + </parent> + + <artifactId>camel-${featureNameLower}-test</artifactId> + <name>Apache Camel :: Karaf :: Tests :: Features :: ${featureName}</name> + + Review Comment: ```suggestion ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org