You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/09/07 01:04:29 UTC

[incubator-servicecomb-java-chassis] 06/08: [SCB-882][WIP] delete useless files

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

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit ad9bcfd0d6d8ae20062ab7df3ae30442156e8233
Author: wujimin <wu...@huawei.com>
AuthorDate: Tue Sep 4 01:02:59 2018 +0800

    [SCB-882][WIP] delete useless files
---
 .../it/testcase/base/TestDataTypeJaxrs.java        |  75 --------------
 .../it/testcase/base/TestDataTypeSpringmvc.java    | 112 ---------------------
 .../it/testcase/support/DataTypePojoIntf.java      |  24 -----
 .../it/testcase/support/DataTypeRestIntf.java      |  56 -----------
 .../it/testcase/support/ProducerDevMode.java       |  22 ----
 .../servicecomb/it/schema/DataTypeJaxrs.java       |  45 ---------
 .../servicecomb/it/schema/DataTypeSpringmvc.java   |  72 -------------
 7 files changed, 406 deletions(-)

diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestDataTypeJaxrs.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestDataTypeJaxrs.java
deleted file mode 100644
index 91b7575..0000000
--- a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestDataTypeJaxrs.java
+++ /dev/null
@@ -1,75 +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.servicecomb.it.testcase.base;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.servicecomb.core.Const;
-import org.apache.servicecomb.it.extend.engine.ITClientHttpRequestFactory;
-import org.apache.servicecomb.it.extend.engine.ITInvoker;
-import org.apache.servicecomb.it.testcase.support.DataTypeRestIntf;
-import org.apache.servicecomb.it.testcase.support.ProducerDevMode;
-import org.apache.servicecomb.provider.springmvc.reference.CseRestTemplate;
-import org.junit.Test;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.client.RestTemplate;
-
-public class TestDataTypeJaxrs {
-  private static DataTypeRestIntf dataTypeIntf;
-
-  private static ITClientHttpRequestFactory clientHttpRequestFactory = new ITClientHttpRequestFactory();
-
-  private static RestTemplate restTemplate = new CseRestTemplate();
-
-  private static String urlPrefix;
-
-  private static String transport;
-
-  static {
-    restTemplate.setRequestFactory(clientHttpRequestFactory);
-  }
-
-  public static void init(String transport, ProducerDevMode producerDevMode) {
-    TestDataTypeJaxrs.transport = transport;
-    dataTypeIntf = ITInvoker
-        .createProxy("it-producer", "dataType" + producerDevMode.name(), transport, DataTypeRestIntf.class);
-
-    clientHttpRequestFactory.setTransport(transport);
-
-    urlPrefix = "cse://it-producer/v1/dataType" + producerDevMode.name();
-  }
-
-  //伪契约不支持 highway
-  @Test
-  public void testRequest_rt() {
-    //@context don not support highway
-    Map<String, String> params = new HashMap<>();
-    params.put("a", "5");
-    params.put("b", "3");
-    if (transport.equals(Const.RESTFUL)) {
-      int result = restTemplate.getForObject(urlPrefix + "/request?a={a}&b={b}", Integer.class, 5, 4);
-      assertEquals(1, result);
-    }
-  }
-}
diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestDataTypeSpringmvc.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestDataTypeSpringmvc.java
deleted file mode 100644
index eeb42d7..0000000
--- a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestDataTypeSpringmvc.java
+++ /dev/null
@@ -1,112 +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.servicecomb.it.testcase.base;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.servicecomb.it.extend.engine.ITClientHttpRequestFactory;
-import org.apache.servicecomb.it.extend.engine.ITInvoker;
-import org.apache.servicecomb.it.testcase.support.DataTypeRestIntf;
-import org.apache.servicecomb.it.testcase.support.ProducerDevMode;
-import org.apache.servicecomb.provider.springmvc.reference.CseRestTemplate;
-import org.junit.Test;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.client.RestTemplate;
-
-public class TestDataTypeSpringmvc {
-  private static DataTypeRestIntf dataTypeIntf;
-
-  private static ITClientHttpRequestFactory clientHttpRequestFactory = new ITClientHttpRequestFactory();
-
-  private static RestTemplate restTemplate = new CseRestTemplate();
-
-  private static String urlPrefix;
-
-  private static String transport;
-
-  static {
-    restTemplate.setRequestFactory(clientHttpRequestFactory);
-  }
-
-  public static void init(String transport, ProducerDevMode producerDevMode) {
-    TestDataTypeSpringmvc.transport = transport;
-    dataTypeIntf = ITInvoker
-        .createProxy("it-producer", "dataType" + producerDevMode.name(), transport, DataTypeRestIntf.class);
-
-    clientHttpRequestFactory.setTransport(transport);
-
-    urlPrefix = "cse://it-producer/v1/dataType" + producerDevMode.name();
-  }
-
-  @Test
-  public void intMulti_intf() {
-    int a = 1, b = 1, c = 1, d = 1, e = 1;
-    assertEquals(String.format("a=%s,b=%s,c=%s,d=%s,e=%s", a, b, c, d, e), dataTypeIntf.intMulti(a, b, c, d, e));
-  }
-
-  @Test
-  public void intMulti_rt() {
-    Map<String, String> params = new HashMap<>();
-    params.put("a", "1");
-    params.put("e", "1");
-    params.put("c", "1");
-    HttpHeaders headers = new HttpHeaders();
-    headers.add(HttpHeaders.COOKIE, "b=1");
-    headers.add("d", "1");
-    HttpEntity<?> requestEntity = new HttpEntity<>(headers);
-    ResponseEntity<String> result = restTemplate.exchange(
-        urlPrefix + "/intMulti/{e}?a={a}&c={c}",
-        HttpMethod.POST,
-        requestEntity,
-        String.class,
-        params);
-    assertEquals(String.format("a=%s,b=%s,c=%s,d=%s,e=%s", 1, 1, 1, 1, 1), result.getBody());
-  }
-
-  @Test
-  public void intRequestQuery_rt() {
-    int expect = 10;
-    Map<String, String> params = new HashMap<>();
-    params.put("a", "10");
-    assertEquals(expect, (int) restTemplate.postForObject(urlPrefix + "/queryRequest?a=" + expect, null, int.class));
-    assertEquals(expect, (int) restTemplate.postForObject(urlPrefix + "/queryRequest?a={a}", null, int.class, params));
-  }
-
-  @Test
-  public void intRequestForm_rt() {
-    HttpHeaders formHeaders = new HttpHeaders();
-    formHeaders.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
-    Map<String, Integer> map = new HashMap<>();
-
-    map.put("form1", 10);
-    map.put("form2", 10);
-    HttpEntity<Map<String, Integer>> formEntiry = new HttpEntity<>(map, formHeaders);
-
-    assertEquals(String.format("form1=%s,form2=%s", 10, 10),
-        restTemplate.postForEntity(urlPrefix + "/formRequest", formEntiry, String.class).getBody());
-    //other method
-    assertEquals(String.format("form1=%s,form2=%s", 10, 10),
-        restTemplate.postForEntity(urlPrefix + "/formRequest", map, String.class).getBody());
-  }
-}
diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/support/DataTypePojoIntf.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/support/DataTypePojoIntf.java
deleted file mode 100644
index eace698..0000000
--- a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/support/DataTypePojoIntf.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.apache.servicecomb.it.testcase.support;/*
- * 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.
- */
-
-public interface DataTypePojoIntf {
-  String checkTransport();
-
-  int intBody(int input);
-
-  int reduce(int a, int b);
-}
diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/support/DataTypeRestIntf.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/support/DataTypeRestIntf.java
deleted file mode 100644
index a1dcd3a..0000000
--- a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/support/DataTypeRestIntf.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.apache.servicecomb.it.testcase.support;/*
- * 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.
- */
-
-public interface DataTypeRestIntf {
-  String checkTransport();
-
-  int intPath(int input);
-
-  int intQuery(int input);
-
-  int intHeader(int input);
-
-  int intCookie(int input);
-
-  int intBody(int input);
-
-  int intForm(int a);
-
-  int intAttribute(int a);
-
-  int intAdd(int a, int b);
-
-  int intPostAdd(int a, int b);
-
-  int defaultPath();
-
-  int intPathWithMinMax(int input);
-
-  int intQueryWithMinMax(int input);
-
-  int intHeaderWithMinMax(int input);
-
-  int intCookieWithMinMax(int input);
-
-  int intFormWithMinMax(int input);
-
-  int intAttributeWithMinMax(int input);
-
-  int intBodyWithMinMax(int input);
-
-  String intMulti(int a, int b, int c, int d, int e);
-}
diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/support/ProducerDevMode.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/support/ProducerDevMode.java
deleted file mode 100644
index c264293..0000000
--- a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/support/ProducerDevMode.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.apache.servicecomb.it.testcase.support;/*
- * 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.
- */
-
-public enum ProducerDevMode {
-  Pojo,
-  Jaxrs,
-  Springmvc
-}
diff --git a/integration-tests/it-producer/src/main/java/org/apache/servicecomb/it/schema/DataTypeJaxrs.java b/integration-tests/it-producer/src/main/java/org/apache/servicecomb/it/schema/DataTypeJaxrs.java
deleted file mode 100644
index 81201e1..0000000
--- a/integration-tests/it-producer/src/main/java/org/apache/servicecomb/it/schema/DataTypeJaxrs.java
+++ /dev/null
@@ -1,45 +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.servicecomb.it.schema;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.CookieParam;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-
-import org.apache.servicecomb.provider.rest.common.RestSchema;
-
-@RestSchema(schemaId = "dataTypeJaxrs")
-@Path("/v1/dataTypeJaxrs")
-public class DataTypeJaxrs {
-  //这个是伪契约,不支持 highway
-  @Path("request")
-  @GET
-  public int request(@Context HttpServletRequest request) {
-    int a = Integer.parseInt(request.getParameter("a"));
-    int b = Integer.parseInt(request.getParameter("b"));
-    return a - b;
-  }
-}
diff --git a/integration-tests/it-producer/src/main/java/org/apache/servicecomb/it/schema/DataTypeSpringmvc.java b/integration-tests/it-producer/src/main/java/org/apache/servicecomb/it/schema/DataTypeSpringmvc.java
deleted file mode 100644
index 9650d40..0000000
--- a/integration-tests/it-producer/src/main/java/org/apache/servicecomb/it/schema/DataTypeSpringmvc.java
+++ /dev/null
@@ -1,72 +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.servicecomb.it.schema;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.DefaultValue;
-
-import org.apache.servicecomb.provider.rest.common.RestSchema;
-import org.springframework.web.bind.annotation.CookieValue;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestAttribute;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-
-@RestSchema(schemaId = "dataTypeSpringmvc")
-@RequestMapping(path = "/v1/dataTypeSpringmvc")
-public class DataTypeSpringmvc {
-  private DataTypePojo pojo = new DataTypePojo();
-
-  @PostMapping(path = "intMulti/{e}")
-  @ApiImplicitParams({
-      @ApiImplicitParam(name = "a", dataType = "integer", format = "int32", paramType = "query"),
-      @ApiImplicitParam(name = "c", dataType = "integer", format = "int32", paramType = "query"),
-      @ApiImplicitParam(name = "d", dataType = "integer", format = "int32", paramType = "header"),
-      @ApiImplicitParam(name = "e", dataType = "integer", format = "int32", paramType = "path"),
-  })
-  public String intMulti(int a, @CookieValue(name = "b") int b, int c, int d, int e) {
-    return String.format("a=%s,b=%s,c=%s,d=%s,e=%s", a, b, c, d, e);
-  }
-
-  @PostMapping(path = "queryRequest")
-  @ApiImplicitParams({
-      @ApiImplicitParam(name = "a", dataType = "integer", format = "int32", paramType = "query"),
-  })
-  public int intRequestQuery(HttpServletRequest request) {
-    return Integer.parseInt(request.getParameter("a"));
-  }
-
-  @PostMapping(path = "formRequest")
-  @ApiImplicitParams({
-      @ApiImplicitParam(name = "form1", dataType = "integer", format = "int32", paramType = "form", value = "a required form param",
-          required = true),
-      @ApiImplicitParam(name = "form2", dataType = "integer", format = "int32", paramType = "form", value = "an optional form param")})
-  public String intRequestForm(HttpServletRequest request) {
-    int form1 = Integer.parseInt(request.getParameter("form1"));
-    int form2 = Integer.parseInt(request.getParameter("form2"));
-    return String.format("form1=%s,form2=%s", form1, form2);
-  }
-}