essobedo commented on code in PR #327: URL: https://github.com/apache/camel-karaf/pull/327#discussion_r1630695812
########## tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelRouteITest.java: ########## @@ -53,6 +53,7 @@ public abstract class AbstractCamelRouteITest extends KarafTestSupport implement public static final int CAMEL_KARAF_INTEGRATION_TEST_DEBUG_DEFAULT_PORT = 8889; public static final String CAMEL_KARAF_INTEGRATION_TEST_DEBUG_PROPERTY = "camel.karaf.itest.debug"; static final String CAMEL_KARAF_INTEGRATION_TEST_ROUTE_SUPPLIERS_PROPERTY = "camel.karaf.itest.route.suppliers"; + static final String CAMEL_KARAF_INTEGRATION_TEST_ROUTE_IGNORE_SUPPLIERS_PROPERTY = "camel.karaf.itest.route.ignore.suppliers"; Review Comment: ```suggestion static final String CAMEL_KARAF_INTEGRATION_TEST_IGNORE_ROUTE_SUPPLIERS_PROPERTY = "camel.karaf.itest.ignore.route.suppliers"; ``` ########## tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelRouteITest.java: ########## @@ -116,6 +117,9 @@ public Option[] config() { if (hasCamelRouteSupplierFilter()) { combine = combine(combine, getCamelRouteSupplierFilter()); } + if (hasCamekKarafTestHint()) { + combine = combine(combine, getCamelRouteIgnoreSupplier()); + } Review Comment: ```suggestion if (hasCamekKarafTestHint()) { combine = combine(combine, getCamelRouteIgnoreSupplier()); } else if (hasCamelRouteSupplierFilter()) { combine = combine(combine, getCamelRouteSupplierFilter()); } ``` They are exclusive, it can only be one or the other ########## tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelRouteITest.java: ########## @@ -189,6 +193,17 @@ private boolean hasCamelRouteSupplierFilter() { return hint != null && hint.camelRouteSuppliers().length > 0; } + private boolean hasCamekKarafTestHint() { + CamelKarafTestHint hint = getClass().getAnnotation(CamelKarafTestHint.class); + return hint != null; + } + + private Option getCamelRouteIgnoreSupplier() { + return CoreOptions.systemProperty(CAMEL_KARAF_INTEGRATION_TEST_ROUTE_IGNORE_SUPPLIERS_PROPERTY) + .value(Boolean.toString(getClass().getAnnotation(CamelKarafTestHint.class).ignoreRouteSuppliers())); Review Comment: ```suggestion .value(Boolean.toString(Boolean.TRUE)); ``` ########## tests/features/camel-core/src/test/java/org/apache/karaf/camel/itest/CamelVmITest.java: ########## @@ -0,0 +1,54 @@ +/* + * Licensed 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.itest; + +import org.apache.camel.Endpoint; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteITest; +import org.apache.karaf.camel.itests.CamelKarafTestHint; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.ops4j.pax.exam.junit.PaxExam; +import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; +import org.ops4j.pax.exam.spi.reactors.PerClass; + +@RunWith(PaxExam.class) +@ExamReactorStrategy(PerClass.class) +@CamelKarafTestHint(isBlueprintTest = true, camelRouteSuppliers = "") +public class CamelVmITest extends AbstractCamelSingleFeatureResultMockBasedRouteITest { + + public String getCamelFeatureName() { + return "camel-core"; + } + + @Override + public String getTestComponentName() { + return "camel-core-test"; + } + + public void setupMock() { + MockEndpoint endpoint = getContext("ctx2").getEndpoint("mock:%s".formatted("camel-vm-test"), MockEndpoint.class); + endpoint.setFailFast(false); + configureMock(endpoint); + Endpoint directEndpoint = getContext("ctx1").hasEndpoint("direct:%s".formatted("camel-vm-test")); + if (directEndpoint != null) { Review Comment: I don't see any assertion ########## tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelRouteITest.java: ########## @@ -189,6 +193,17 @@ private boolean hasCamelRouteSupplierFilter() { return hint != null && hint.camelRouteSuppliers().length > 0; } + private boolean hasCamekKarafTestHint() { + CamelKarafTestHint hint = getClass().getAnnotation(CamelKarafTestHint.class); + return hint != null; + } Review Comment: ```suggestion private boolean ignoreCamelRouteSuppliers() { CamelKarafTestHint hint = getClass().getAnnotation(CamelKarafTestHint.class); return hint != null && hint.ignoreRouteSuppliers(); } ``` ########## tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelRouteITest.java: ########## @@ -189,6 +193,17 @@ private boolean hasCamelRouteSupplierFilter() { return hint != null && hint.camelRouteSuppliers().length > 0; } + private boolean hasCamekKarafTestHint() { + CamelKarafTestHint hint = getClass().getAnnotation(CamelKarafTestHint.class); + return hint != null; + } + + private Option getCamelRouteIgnoreSupplier() { Review Comment: ```suggestion private Option getIgnoreCamelRouteSuppliers() { ``` ########## tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/CamelSuppliedRouteLauncher.java: ########## @@ -61,17 +63,22 @@ public void deactivate() { } private void loadSuppliers() { - String property = System.getProperty(CAMEL_KARAF_INTEGRATION_TEST_ROUTE_SUPPLIERS_PROPERTY); - if (property == null) { - return; + final String property = System.getProperty(CAMEL_KARAF_INTEGRATION_TEST_ROUTE_SUPPLIERS_PROPERTY); + if (property != null) { + suppliers.addAll(List.of(property.split(","))); + } + String ignoreProperty = System.getProperty(CAMEL_KARAF_INTEGRATION_TEST_ROUTE_IGNORE_SUPPLIERS_PROPERTY); + if (ignoreProperty != null) { + ignoreSuppliers = Boolean.parseBoolean(ignoreProperty); } Review Comment: ```suggestion String ignoreProperty = System.getProperty(CAMEL_KARAF_INTEGRATION_TEST_ROUTE_IGNORE_SUPPLIERS_PROPERTY); if (ignoreProperty != null) { ignoreSuppliers = true; return; } String property = System.getProperty(CAMEL_KARAF_INTEGRATION_TEST_ROUTE_SUPPLIERS_PROPERTY); if (property == null) { return; suppliers.addAll(List.of(property.split(","))); ``` Again they are exclusives -- 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