This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git


The following commit(s) were added to refs/heads/master by this push:
     new ace8413  add integration tests
ace8413 is described below

commit ace841300f3cc0779d2516a27da5a1e6984225ef
Author: ken.lj <[email protected]>
AuthorDate: Sat Jan 29 12:03:24 2022 +0800

    add integration tests
---
 .../servicediscovery-transfer-consumer-old/pom.xml | 11 ++++++
 .../java/org/apache/dubbo/demo/DemoServiceIT.java  | 37 ++++++++++++++++++++
 .../apache/dubbo/demo/consumer/DemoServiceIT.java  | 39 ++++++++++++++++++++++
 3 files changed, 87 insertions(+)

diff --git 
a/dubbo-samples-cloud-native/servicediscovery-transfer/servicediscovery-transfer-consumer-old/pom.xml
 
b/dubbo-samples-cloud-native/servicediscovery-transfer/servicediscovery-transfer-consumer-old/pom.xml
index c2e8c39..e696106 100644
--- 
a/dubbo-samples-cloud-native/servicediscovery-transfer/servicediscovery-transfer-consumer-old/pom.xml
+++ 
b/dubbo-samples-cloud-native/servicediscovery-transfer/servicediscovery-transfer-consumer-old/pom.xml
@@ -35,6 +35,17 @@
             <artifactId>servicediscovery-transfer-api</artifactId>
             <version>${project.parent.version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${junit.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git 
a/dubbo-samples-cloud-native/servicediscovery-transfer/servicediscovery-transfer-consumer-old/src/test/java/org/apache/dubbo/demo/DemoServiceIT.java
 
b/dubbo-samples-cloud-native/servicediscovery-transfer/servicediscovery-transfer-consumer-old/src/test/java/org/apache/dubbo/demo/DemoServiceIT.java
new file mode 100644
index 0000000..ed4fcf1
--- /dev/null
+++ 
b/dubbo-samples-cloud-native/servicediscovery-transfer/servicediscovery-transfer-consumer-old/src/test/java/org/apache/dubbo/demo/DemoServiceIT.java
@@ -0,0 +1,37 @@
+/*
+ * 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.dubbo.demo;
+
+import org.junit.Assert;
+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;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations = "classpath*:spring/dubbo-consumer.xml")
+public class DemoServiceIT {
+    @Autowired
+    private DemoService demoService;
+
+    @Test
+    public void test() throws Exception {
+        String result = demoService.sayHello("test");
+        Assert.assertTrue(result.contains("Hello test, "));
+    }
+}
diff --git 
a/dubbo-samples-cloud-native/servicediscovery-transfer/servicediscovery-transfer-consumer/src/test/java/org/apache/dubbo/demo/consumer/DemoServiceIT.java
 
b/dubbo-samples-cloud-native/servicediscovery-transfer/servicediscovery-transfer-consumer/src/test/java/org/apache/dubbo/demo/consumer/DemoServiceIT.java
new file mode 100644
index 0000000..9b81d88
--- /dev/null
+++ 
b/dubbo-samples-cloud-native/servicediscovery-transfer/servicediscovery-transfer-consumer/src/test/java/org/apache/dubbo/demo/consumer/DemoServiceIT.java
@@ -0,0 +1,39 @@
+/*
+ * 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.dubbo.demo.consumer;
+
+import org.apache.dubbo.demo.GreetingService;
+
+import org.junit.Assert;
+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;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations = "classpath*:spring/dubbo-consumer.xml")
+public class DemoServiceIT {
+    @Autowired
+    private GreetingService greetingService;
+
+    @Test
+    public void test() throws Exception {
+        String result = greetingService.hello();
+        Assert.assertEquals("Greetings from server!", result);
+    }
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to