add case-configuration.yml in dubbo-samples-consul (#238)
diff --git a/dubbo-samples-consul/case-configuration.yml b/dubbo-samples-consul/case-configuration.yml
new file mode 100644
index 0000000..03d7ce1
--- /dev/null
+++ b/dubbo-samples-consul/case-configuration.yml
@@ -0,0 +1,46 @@
+# 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.
+
+services:
+ consul:
+ image: consul:1.9.1
+
+ dubbo-samples-consul:
+ type: app
+ basedir: .
+ mainClass: org.apache.dubbo.samples.consul.ConsulProvider
+ systemProps:
+ - consul.address=consul
+ - consul.port=8500
+ waitPortsBeforeRun:
+ - consul:8500
+ depends_on:
+ - consul
+
+ dubbo-samples-consul-test:
+ type: test
+ basedir: .
+ tests:
+ - "**/*IT.class"
+ systemProps:
+ - consul.address=consul
+ - consul.port=8500
+ waitPortsBeforeRun:
+ - consul:8500
+ - dubbo-samples-consul:20880
+ depends_on:
+ - consul
+ - dubbo-samples-consul
diff --git a/dubbo-samples-consul/pom.xml b/dubbo-samples-consul/pom.xml
index e138f39..967cb2c 100644
--- a/dubbo-samples-consul/pom.xml
+++ b/dubbo-samples-consul/pom.xml
@@ -47,6 +47,35 @@
<type>pom</type>
<scope>import</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-framework-bom</artifactId>
+ <version>${spring.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-bom</artifactId>
+ <version>${dubbo.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-dependencies-zookeeper</artifactId>
+ <version>${dubbo.version}</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -54,13 +83,11 @@
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
- <version>${dubbo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
- <version>${dubbo.version}</version>
<type>pom</type>
</dependency>
@@ -77,51 +104,17 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
- <version>${spring.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.testcontainers</groupId>
- <artifactId>testcontainers</artifactId>
- <version>1.12.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
- <profile>
- <id>dubbo-integration-test</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <version>${maven-failsafe-plugin.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- <configuration>
- <includes>
- <include>**/*IT.java</include>
- </includes>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
<!-- For jdk 11 above JavaEE annotation -->
<profile>
<id>javax.annotation</id>
diff --git a/dubbo-samples-consul/src/test/java/org/apache/dubbo/samples/consul/DemoServiceIT.java b/dubbo-samples-consul/src/test/java/org/apache/dubbo/samples/consul/DemoServiceIT.java
index 7d4efae..26473d4 100644
--- a/dubbo-samples-consul/src/test/java/org/apache/dubbo/samples/consul/DemoServiceIT.java
+++ b/dubbo-samples-consul/src/test/java/org/apache/dubbo/samples/consul/DemoServiceIT.java
@@ -20,25 +20,18 @@
import org.apache.dubbo.samples.consul.api.DemoService;
import org.junit.Assert;
-import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.testcontainers.containers.FixedHostPortGenericContainer;
-import org.testcontainers.containers.GenericContainer;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = {"classpath*:spring/dubbo-demo-consumer.xml", "classpath*:spring/dubbo-demo-provider.xml"})
+@ContextConfiguration(locations = "classpath*:spring/dubbo-demo-consumer.xml")
public class DemoServiceIT {
@Autowired
private DemoService service;
- @ClassRule
- public static GenericContainer zookeeper = new FixedHostPortGenericContainer("consul:1.5.3")
- .withFixedExposedPort(8500, 8500);
-
@Test
public void test() throws Exception {
Assert.assertEquals("hello, dubbo", service.sayHello("dubbo"));