Add hessian testcase
diff --git a/api/src/main/java/com/alibaba/dubbo/test/service/HessianService.java b/api/src/main/java/com/alibaba/dubbo/test/service/HessianService.java
new file mode 100644
index 0000000..e852159
--- /dev/null
+++ b/api/src/main/java/com/alibaba/dubbo/test/service/HessianService.java
@@ -0,0 +1,9 @@
+package com.alibaba.dubbo.test.service;
+
+/**
+ * @author ken.lj
+ * @date 2017/11/4
+ */
+public interface HessianService {
+ String hello();
+}
diff --git a/api/src/main/java/com/alibaba/dubbo/test/service/HttpService.java b/api/src/main/java/com/alibaba/dubbo/test/service/HttpService.java
new file mode 100644
index 0000000..bbd81f5
--- /dev/null
+++ b/api/src/main/java/com/alibaba/dubbo/test/service/HttpService.java
@@ -0,0 +1,8 @@
+package com.alibaba.dubbo.test.service;
+
+/**
+ * @author ken.lj
+ * @date 2017/11/4
+ */
+public interface HttpService {
+}
diff --git a/consumer-test/src/main/java/com/alibaba/dubbo/test/web/HessianController.java b/consumer-test/src/main/java/com/alibaba/dubbo/test/web/HessianController.java
new file mode 100644
index 0000000..010f94f
--- /dev/null
+++ b/consumer-test/src/main/java/com/alibaba/dubbo/test/web/HessianController.java
@@ -0,0 +1,25 @@
+package com.alibaba.dubbo.test.web;
+
+import com.alibaba.dubbo.test.service.HessianService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author ken.lj
+ * @date 2017/11/4
+ */
+@RestController
+@RequestMapping("/hessian")
+public class HessianController {
+
+ @Autowired(required = false)
+ private HessianService hessianService;
+
+ @RequestMapping("/hello")
+ public String testSimple() {
+ String result = hessianService.hello();
+ return result;
+ }
+}
diff --git a/consumer-test/src/main/resources/dubbo-hessian.xml b/consumer-test/src/main/resources/dubbo-hessian.xml
new file mode 100644
index 0000000..9320409
--- /dev/null
+++ b/consumer-test/src/main/resources/dubbo-hessian.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ - Copyright 1999-2011 Alibaba Group.
+ -
+ - 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.
+-->
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+ xmlns="http://www.springframework.org/schema/beans"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
+
+ <dubbo:reference id="hessianService" interface="com.alibaba.dubbo.test.service.HessianService" protocol="hessian"/>
+
+</beans>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 481a537..0f711e6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,7 +50,7 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
- <version>2.5.7-SNAPSHOT</version>
+ <version>2.5.7</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
diff --git a/provider-test/pom.xml b/provider-test/pom.xml
index 0a337b1..257ea38 100644
--- a/provider-test/pom.xml
+++ b/provider-test/pom.xml
@@ -21,14 +21,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-jdbc</artifactId>
- </dependency>
<dependency>
<groupId>com.h2database</groupId>
diff --git a/provider-test/src/main/java/com/alibaba/dubbo/test/service/impl/AnnotateServiceImpl.java b/provider-test/src/main/java/com/alibaba/dubbo/test/service/impl/AnnotateServiceImpl.java
index 0f5035b..b0fe664 100644
--- a/provider-test/src/main/java/com/alibaba/dubbo/test/service/impl/AnnotateServiceImpl.java
+++ b/provider-test/src/main/java/com/alibaba/dubbo/test/service/impl/AnnotateServiceImpl.java
@@ -2,9 +2,6 @@
import com.alibaba.dubbo.test.service.AnnotateService;
-import org.springframework.transaction.annotation.Transactional;
-
-
/**
* @author ken.lj
* @date 2017/09/10
@@ -13,7 +10,6 @@
public class AnnotateServiceImpl implements AnnotateService {
@Override
- @Transactional
public String sayHello() {
return "Hello";
}
diff --git a/provider-test/src/main/java/com/alibaba/dubbo/test/service/impl/DemoServiceImpl.java b/provider-test/src/main/java/com/alibaba/dubbo/test/service/impl/DemoServiceImpl.java
index 82ba4c5..7f0a4da 100644
--- a/provider-test/src/main/java/com/alibaba/dubbo/test/service/impl/DemoServiceImpl.java
+++ b/provider-test/src/main/java/com/alibaba/dubbo/test/service/impl/DemoServiceImpl.java
@@ -5,7 +5,6 @@
import com.alibaba.dubbo.test.service.DemoService;
import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@@ -17,7 +16,6 @@
@Service("demoService")
public class DemoServiceImpl implements DemoService {
@Override
- @Transactional
public String testString(String str) {
return str;
}
diff --git a/provider-test/src/main/java/com/alibaba/dubbo/test/service/impl/HessianServiceImpl.java b/provider-test/src/main/java/com/alibaba/dubbo/test/service/impl/HessianServiceImpl.java
new file mode 100644
index 0000000..8909bb2
--- /dev/null
+++ b/provider-test/src/main/java/com/alibaba/dubbo/test/service/impl/HessianServiceImpl.java
@@ -0,0 +1,17 @@
+package com.alibaba.dubbo.test.service.impl;
+
+import com.alibaba.dubbo.test.service.HessianService;
+
+import org.springframework.stereotype.Service;
+
+/**
+ * @author ken.lj
+ * @date 2017/11/4
+ */
+@Service("hessianService")
+public class HessianServiceImpl implements HessianService {
+ @Override
+ public String hello() {
+ return "hessian";
+ }
+}
diff --git a/provider-test/src/main/resources/dubbo-common.xml b/provider-test/src/main/resources/dubbo-common.xml
index 7ad547c..dfa2819 100644
--- a/provider-test/src/main/resources/dubbo-common.xml
+++ b/provider-test/src/main/resources/dubbo-common.xml
@@ -30,8 +30,10 @@
<dubbo:registry client="curator" group="testgroup" address="zookeeper://127.0.0.1:2181"/>
<!-- 用dubbo协议在20880端口暴露服务 -->
- <dubbo:protocol accesslog="true" name="dubbo" port="-1" transporter="netty4"/>
+ <dubbo:protocol default="true" accesslog="true" name="dubbo" port="-1" transporter="netty4"/>
<dubbo:provider delay="-1"/>
+ <dubbo:monitor protocol="registry"/>
+
</beans>
\ No newline at end of file
diff --git a/provider-test/src/main/resources/dubbo-hessian.xml b/provider-test/src/main/resources/dubbo-hessian.xml
new file mode 100644
index 0000000..bc0d71b
--- /dev/null
+++ b/provider-test/src/main/resources/dubbo-hessian.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ - Copyright 1999-2011 Alibaba Group.
+ -
+ - 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.
+-->
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+ xmlns="http://www.springframework.org/schema/beans"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
+
+ <dubbo:protocol default="false" id="hessianprotocol" name="hessian" port="8080" server="jetty"/>
+ <dubbo:service protocol="hessianprotocol" interface="com.alibaba.dubbo.test.service.HessianService"
+ ref="hessianService"/>
+
+</beans>
\ No newline at end of file