You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by hu...@apache.org on 2019/03/07 08:26:21 UTC

[incubator-dubbo] branch master updated: Merge RestProtocolTest.java (#3597)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new fe049b8  Merge RestProtocolTest.java (#3597)
fe049b8 is described below

commit fe049b8ddd29cd4539d9603bdc680f1e43a7d784
Author: huazhongming <cr...@gmail.com>
AuthorDate: Thu Mar 7 16:26:17 2019 +0800

    Merge RestProtocolTest.java (#3597)
---
 .../dubbo/rpc/protocol/rest/DemoService.java       | 29 +++++--
 .../rest/DemoServiceImpl.java}                     | 78 +++++++++--------
 .../dubbo/rpc/protocol/rest/IDemoService.java      | 32 -------
 .../dubbo/rpc/protocol/rest/RestProtocolTest.java  | 98 +++++++++++++++-------
 .../dubbo/rpc/protol/rest/RestProtocolTest.java    | 76 -----------------
 .../apache/dubbo/rpc/protol/rest/RestService.java  | 36 --------
 6 files changed, 131 insertions(+), 218 deletions(-)

diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/DemoService.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/DemoService.java
index 5bcbbd2..bb9e4a8 100644
--- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/DemoService.java
+++ b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/DemoService.java
@@ -16,15 +16,26 @@
  */
 package org.apache.dubbo.rpc.protocol.rest;
 
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
 
-public class DemoService implements IDemoService {
-    @Override
-    public Integer hello(Integer a, Integer b) {
-        return a + b;
-    }
 
-    @Override
-    public String error() {
-        throw new RuntimeException();
-    }
+@Path("/demoService")
+public interface DemoService {
+    @GET
+    @Path("/hello")
+    Integer hello(@QueryParam("a") Integer a, @QueryParam("b") Integer b);
+
+    @GET
+    @Path("/error")
+    String error();
+
+    @POST
+    @Path("/say")
+    @Consumes({MediaType.TEXT_PLAIN})
+    String sayHello(String name);
 }
diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protol/rest/RestServiceImpl.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/DemoServiceImpl.java
similarity index 78%
rename from dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protol/rest/RestServiceImpl.java
rename to dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/DemoServiceImpl.java
index e9d31dc..37ec29a 100644
--- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protol/rest/RestServiceImpl.java
+++ b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/DemoServiceImpl.java
@@ -1,36 +1,42 @@
-/*
- * 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.rpc.protol.rest;
-
-/**
- * RestServiceImpl
- */
-
-public class RestServiceImpl implements RestService {
-
-    private boolean called;
-
-    public String sayHello(String name) {
-        called = true;
-        return "Hello, " + name;
-    }
-
-
-    public boolean isCalled() {
-        return called;
-    }
-}
+/*
+ * 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.rpc.protocol.rest;
+
+
+public class DemoServiceImpl implements DemoService {
+    private boolean called;
+
+    public String sayHello(String name) {
+        called = true;
+        return "Hello, " + name;
+    }
+
+
+    public boolean isCalled() {
+        return called;
+    }
+
+    @Override
+    public Integer hello(Integer a, Integer b) {
+        return a + b;
+    }
+
+    @Override
+    public String error() {
+        throw new RuntimeException();
+    }
+}
diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/IDemoService.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/IDemoService.java
deleted file mode 100644
index 47dbfb7..0000000
--- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/IDemoService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.rpc.protocol.rest;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.QueryParam;
-
-@Path("/demoService")
-public interface IDemoService {
-    @GET
-    @Path("/hello")
-    Integer hello(@QueryParam("a") Integer a, @QueryParam("b") Integer b);
-
-    @GET
-    @Path("/error")
-    String error();
-}
diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/RestProtocolTest.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/RestProtocolTest.java
index c2f2360..df86ab2 100644
--- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/RestProtocolTest.java
+++ b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/RestProtocolTest.java
@@ -25,6 +25,7 @@ import org.apache.dubbo.rpc.Protocol;
 import org.apache.dubbo.rpc.ProxyFactory;
 import org.apache.dubbo.rpc.Result;
 import org.apache.dubbo.rpc.RpcContext;
+import org.apache.dubbo.rpc.Invoker;
 import org.apache.dubbo.rpc.RpcException;
 import org.apache.dubbo.rpc.RpcInvocation;
 import org.apache.dubbo.rpc.model.ApplicationModel;
@@ -50,15 +51,54 @@ public class RestProtocolTest {
     }
 
     @Test
+    public void testRestProtocol() {
+        URL url = URL.valueOf("rest://127.0.0.1:5342/rest/say?version=1.0.0");
+        DemoServiceImpl server = new DemoServiceImpl();
+        ProviderModel providerModel = new ProviderModel(url.getServiceKey(), server, DemoService.class);
+        ApplicationModel.initProviderModel(url.getServiceKey(), providerModel);
+
+        Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(server, DemoService.class, url));
+        Invoker<DemoService> invoker = protocol.refer(DemoService.class, url);
+        Assertions.assertFalse(server.isCalled());
+
+        DemoService client = proxy.getProxy(invoker);
+        String result = client.sayHello("haha");
+        Assertions.assertTrue(server.isCalled());
+        Assertions.assertEquals("Hello, haha", result);
+        invoker.destroy();
+        exporter.unexport();
+    }
+
+    @Test
+    public void testRestProtocolWithContextPath() {
+        DemoServiceImpl server = new DemoServiceImpl();
+        Assertions.assertFalse(server.isCalled());
+        URL url = URL.valueOf("rest://127.0.0.1:5341/a/b/c?version=1.0.0");
+        ProviderModel providerModel = new ProviderModel(url.getServiceKey(), server, DemoService.class);
+        ApplicationModel.initProviderModel(url.getServiceKey(), providerModel);
+
+        Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(server, DemoService.class, url));
+
+        url = URL.valueOf("rest://127.0.0.1:5341/a/b/c/?version=1.0.0");
+        Invoker<DemoService> invoker = protocol.refer(DemoService.class, url);
+        DemoService client = proxy.getProxy(invoker);
+        String result = client.sayHello("haha");
+        Assertions.assertTrue(server.isCalled());
+        Assertions.assertEquals("Hello, haha", result);
+        invoker.destroy();
+        exporter.unexport();
+    }
+
+    @Test
     public void testExport() {
-        IDemoService server = new DemoService();
-        ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, IDemoService.class);
+        DemoService server = new DemoServiceImpl();
+        ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, DemoService.class);
         ApplicationModel.initProviderModel(exportUrl.getServiceKey(), providerModel);
 
         RpcContext.getContext().setAttachment("timeout", "200");
-        Exporter<IDemoService> exporter = protocol.export(proxy.getInvoker(server, IDemoService.class, exportUrl));
+        Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(server, DemoService.class, exportUrl));
 
-        IDemoService demoService = this.proxy.getProxy(protocol.refer(IDemoService.class, exportUrl));
+        DemoService demoService = this.proxy.getProxy(protocol.refer(DemoService.class, exportUrl));
 
         Integer echoString = demoService.hello(1, 2);
         assertThat(echoString, is(3));
@@ -68,14 +108,14 @@ public class RestProtocolTest {
 
     @Test
     public void testNettyServer() {
-        IDemoService server = new DemoService();
-        ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, IDemoService.class);
+        DemoService server = new DemoServiceImpl();
+        ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, DemoService.class);
         ApplicationModel.initProviderModel(exportUrl.getServiceKey(), providerModel);
 
         URL nettyUrl = exportUrl.addParameter(Constants.SERVER_KEY, "netty");
-        Exporter<IDemoService> exporter = protocol.export(proxy.getInvoker(new DemoService(), IDemoService.class, nettyUrl));
+        Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(new DemoServiceImpl(), DemoService.class, nettyUrl));
 
-        IDemoService demoService = this.proxy.getProxy(protocol.refer(IDemoService.class, nettyUrl));
+        DemoService demoService = this.proxy.getProxy(protocol.refer(DemoService.class, nettyUrl));
 
         Integer echoString = demoService.hello(10, 10);
         assertThat(echoString, is(20));
@@ -86,27 +126,27 @@ public class RestProtocolTest {
     @Test
     public void testServletWithoutWebConfig() {
         Assertions.assertThrows(RpcException.class, () -> {
-            IDemoService server = new DemoService();
-            ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, IDemoService.class);
+            DemoService server = new DemoServiceImpl();
+            ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, DemoService.class);
             ApplicationModel.initProviderModel(exportUrl.getServiceKey(), providerModel);
 
             URL servletUrl = exportUrl.addParameter(Constants.SERVER_KEY, "servlet");
 
-            protocol.export(proxy.getInvoker(server, IDemoService.class, servletUrl));
+            protocol.export(proxy.getInvoker(server, DemoService.class, servletUrl));
         });
     }
 
     @Test
     public void testErrorHandler() {
         Assertions.assertThrows(RpcException.class, () -> {
-            IDemoService server = new DemoService();
-            ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, IDemoService.class);
+            DemoService server = new DemoServiceImpl();
+            ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, DemoService.class);
             ApplicationModel.initProviderModel(exportUrl.getServiceKey(), providerModel);
 
             URL nettyUrl = exportUrl.addParameter(Constants.SERVER_KEY, "netty");
-            Exporter<IDemoService> exporter = protocol.export(proxy.getInvoker(server, IDemoService.class, nettyUrl));
+            Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(server, DemoService.class, nettyUrl));
 
-            IDemoService demoService = this.proxy.getProxy(protocol.refer(IDemoService.class, nettyUrl));
+            DemoService demoService = this.proxy.getProxy(protocol.refer(DemoService.class, nettyUrl));
 
             demoService.error();
         });
@@ -114,12 +154,12 @@ public class RestProtocolTest {
 
     @Test
     public void testInvoke() {
-        IDemoService server = new DemoService();
-        ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, IDemoService.class);
+        DemoService server = new DemoServiceImpl();
+        ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, DemoService.class);
         ApplicationModel.initProviderModel(exportUrl.getServiceKey(), providerModel);
 
 
-        Exporter<IDemoService> exporter = protocol.export(proxy.getInvoker(server, IDemoService.class, exportUrl));
+        Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(server, DemoService.class, exportUrl));
 
         RpcInvocation rpcInvocation = new RpcInvocation("hello", new Class[]{Integer.class, Integer.class}, new Integer[]{2, 3});
 
@@ -129,15 +169,15 @@ public class RestProtocolTest {
 
     @Test
     public void testFilter() {
-        IDemoService server = new DemoService();
-        ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, IDemoService.class);
+        DemoService server = new DemoServiceImpl();
+        ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, DemoService.class);
         ApplicationModel.initProviderModel(exportUrl.getServiceKey(), providerModel);
 
         URL nettyUrl = exportUrl.addParameter(Constants.SERVER_KEY, "netty")
                 .addParameter(Constants.EXTENSION_KEY, "org.apache.dubbo.rpc.protocol.rest.support.LoggingFilter");
-        Exporter<IDemoService> exporter = protocol.export(proxy.getInvoker(server, IDemoService.class, nettyUrl));
+        Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(server, DemoService.class, nettyUrl));
 
-        IDemoService demoService = this.proxy.getProxy(protocol.refer(IDemoService.class, nettyUrl));
+        DemoService demoService = this.proxy.getProxy(protocol.refer(DemoService.class, nettyUrl));
 
         Integer result = demoService.hello(1, 2);
 
@@ -148,16 +188,16 @@ public class RestProtocolTest {
 
     @Test
     public void testRpcContextFilter() {
-        IDemoService server = new DemoService();
-        ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, IDemoService.class);
+        DemoService server = new DemoServiceImpl();
+        ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, DemoService.class);
         ApplicationModel.initProviderModel(exportUrl.getServiceKey(), providerModel);
 
         // use RpcContextFilter
         URL nettyUrl = exportUrl.addParameter(Constants.SERVER_KEY, "netty")
                 .addParameter(Constants.EXTENSION_KEY, "org.apache.dubbo.rpc.protocol.rest.RpcContextFilter");
-        Exporter<IDemoService> exporter = protocol.export(proxy.getInvoker(server, IDemoService.class, nettyUrl));
+        Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(server, DemoService.class, nettyUrl));
 
-        IDemoService demoService = this.proxy.getProxy(protocol.refer(IDemoService.class, nettyUrl));
+        DemoService demoService = this.proxy.getProxy(protocol.refer(DemoService.class, nettyUrl));
 
         String value = null;
         // put a null value into attachment.
@@ -172,12 +212,12 @@ public class RestProtocolTest {
     @Test
     public void testRegFail() {
         Assertions.assertThrows(RuntimeException.class, () -> {
-            IDemoService server = new DemoService();
-            ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, IDemoService.class);
+            DemoService server = new DemoServiceImpl();
+            ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, DemoService.class);
             ApplicationModel.initProviderModel(exportUrl.getServiceKey(), providerModel);
 
             URL nettyUrl = exportUrl.addParameter(Constants.EXTENSION_KEY, "com.not.existing.Filter");
-            protocol.export(proxy.getInvoker(server, IDemoService.class, nettyUrl));
+            protocol.export(proxy.getInvoker(server, DemoService.class, nettyUrl));
         });
     }
 
diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protol/rest/RestProtocolTest.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protol/rest/RestProtocolTest.java
deleted file mode 100644
index 7ab27ca..0000000
--- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protol/rest/RestProtocolTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.rpc.protol.rest;
-
-import org.apache.dubbo.common.URL;
-import org.apache.dubbo.common.extension.ExtensionLoader;
-import org.apache.dubbo.rpc.Exporter;
-import org.apache.dubbo.rpc.Invoker;
-import org.apache.dubbo.rpc.Protocol;
-import org.apache.dubbo.rpc.ProxyFactory;
-import org.apache.dubbo.rpc.model.ApplicationModel;
-import org.apache.dubbo.rpc.model.ProviderModel;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.Test;
-
-/**
- * RestProtocolTest
- */
-public class RestProtocolTest {
-
-    private Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
-    private ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
-
-    @Test
-    public void testRestProtocol() {
-        URL url = URL.valueOf("rest://127.0.0.1:5342/rest/say1?version=1.0.0");
-        RestServiceImpl server = new RestServiceImpl();
-        ProviderModel providerModel = new ProviderModel(url.getServiceKey(), server, RestService.class);
-        ApplicationModel.initProviderModel(url.getServiceKey(), providerModel);
-
-        Exporter<RestService> exporter = protocol.export(proxyFactory.getInvoker(server, RestService.class, url));
-        Invoker<RestService> invoker = protocol.refer(RestService.class, url);        Assertions.assertFalse(server.isCalled());
-
-        RestService client = proxyFactory.getProxy(invoker);
-        String result = client.sayHello("haha");
-        Assertions.assertTrue(server.isCalled());
-        Assertions.assertEquals("Hello, haha", result);
-        invoker.destroy();
-        exporter.unexport();
-    }
-
-    @Test
-    public void testRestProtocolWithContextPath() {
-        RestServiceImpl server = new RestServiceImpl();
-        Assertions.assertFalse(server.isCalled());
-        URL url = URL.valueOf("rest://127.0.0.1:5341/a/b/c?version=1.0.0");
-        ProviderModel providerModel = new ProviderModel(url.getServiceKey(), server, RestService.class);
-        ApplicationModel.initProviderModel(url.getServiceKey(), providerModel);
-
-        Exporter<RestService> exporter = protocol.export(proxyFactory.getInvoker(server, RestService.class, url));
-
-        url = URL.valueOf("rest://127.0.0.1:5341/a/b/c/?version=1.0.0");
-        Invoker<RestService> invoker = protocol.refer(RestService.class, url);
-        RestService client = proxyFactory.getProxy(invoker);
-        String result = client.sayHello("haha");
-        Assertions.assertTrue(server.isCalled());
-        Assertions.assertEquals("Hello, haha", result);
-        invoker.destroy();
-        exporter.unexport();
-    }
-}
diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protol/rest/RestService.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protol/rest/RestService.java
deleted file mode 100644
index fe0d588..0000000
--- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protol/rest/RestService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.rpc.protol.rest;
-
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.core.MediaType;
-
-/**
- * RestService
- */
-@Path("/rest")
-public interface RestService {
-
-    @POST
-    @Path("/say1")
-    @Consumes({MediaType.TEXT_PLAIN})
-    String sayHello(String name);
-
-}