jonomorris commented on code in PR #18918: URL: https://github.com/apache/camel/pull/18918#discussion_r2279006593
########## test-infra/camel-test-infra-ibmmq/src/main/java/org/apache/camel/test/infra/ibmmq/services/IbmMQLocalContainerInfraService.java: ########## @@ -0,0 +1,117 @@ +/* + * 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.test.infra.ibmmq.services; + +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.common.LocalPropertyResolver; +import org.apache.camel.test.infra.common.services.ContainerService; +import org.apache.camel.test.infra.ibmmq.common.IbmMQProperties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.utility.DockerImageName; + +@InfraService(service = IbmMQInfraService.class, + description = "IBM MQ messaging middleware", + serviceAlias = "ibmmq") +public class IbmMQLocalContainerInfraService implements IbmMQInfraService, ContainerService<GenericContainer<?>> { + + public static final String CONTAINER_NAME = "ibmmq"; + public static final int MQ_LISTENER_PORT = 1414; + public static final int WEB_CONSOLE_PORT = 9443; + + private static final Logger LOG = LoggerFactory.getLogger(IbmMQLocalContainerInfraService.class); + + private final GenericContainer<?> container; + + public IbmMQLocalContainerInfraService() { + this(LocalPropertyResolver.getProperty( + IbmMQLocalContainerInfraService.class, IbmMQProperties.IBM_MQ_CONTAINER)); + } + + public IbmMQLocalContainerInfraService(String containerImage) { + container = initContainer(containerImage); + } + + protected GenericContainer<?> initContainer(String imageName) { + + class IbmMQContainer extends GenericContainer<IbmMQContainer> { + public IbmMQContainer() { + super(DockerImageName.parse(imageName)); + + withNetworkAliases(CONTAINER_NAME) + .withEnv("LICENSE", "accept") Review Comment: Note that we need to agree the 'MQ Advanced for Developers' license when running the container. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
