You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2019/07/22 02:54:08 UTC
[servicecomb-toolkit] 02/02: fix the problem according code review
suggestion
This is an automated email from the ASF dual-hosted git repository.
ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-toolkit.git
commit e3eea776c938a0ad1ffaaf3fed67d12a13e57e3c
Author: MabinGo <bi...@huawei.com>
AuthorDate: Sun Jul 21 21:08:48 2019 +0800
fix the problem according code review suggestion
Signed-off-by: MabinGo <bi...@huawei.com>
---
.../contractgen/DefaultContractsGeneratorTest.java | 6 ---
contractgen/src/test/projects/demo/pom.xml | 40 +++++++-------
.../demo-with-contract/pom-gencontract.xml | 61 ----------------------
.../src/test/projects/demo-with-contract/pom.xml | 40 +++++++-------
.../demo-without-contract/pom-gencontract.xml | 60 ---------------------
.../test/projects/demo-without-contract/pom.xml | 40 +++++++-------
6 files changed, 54 insertions(+), 193 deletions(-)
diff --git a/contractgen/src/test/java/org/apache/servicecomb/toolkit/contractgen/DefaultContractsGeneratorTest.java b/contractgen/src/test/java/org/apache/servicecomb/toolkit/contractgen/DefaultContractsGeneratorTest.java
index a4f16a4..c29555c 100644
--- a/contractgen/src/test/java/org/apache/servicecomb/toolkit/contractgen/DefaultContractsGeneratorTest.java
+++ b/contractgen/src/test/java/org/apache/servicecomb/toolkit/contractgen/DefaultContractsGeneratorTest.java
@@ -37,7 +37,6 @@ import java.util.concurrent.TimeoutException;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.plugin.testing.resources.TestResources;
import org.apache.maven.project.MavenProject;
-import org.apache.servicecomb.provider.rest.common.RestSchema;
import org.apache.servicecomb.toolkit.ContractsGenerator;
import org.apache.servicecomb.toolkit.GeneratorFactory;
import org.apache.servicecomb.toolkit.common.ClassMaker;
@@ -117,11 +116,6 @@ public class DefaultContractsGeneratorTest {
method.setAccessible(true);
assertFalse((boolean) method.invoke(defaultContractsGenerator, new Object[] {null}));
-
-// Class<Runnable> mockRunnableaClass = (Class<Runnable>)mock(Class.class);
-// RestSchema restSchema = mock(RestSchema.class);
-// given(mockRunnableaClass.getAnnotation(RestSchema.class)).willReturn(restSchema);
-// assertTrue((boolean) method.invoke(defaultContractsGenerator, new Object[] {mockRunnableaClass}));
}
@Test
diff --git a/contractgen/src/test/projects/demo/pom.xml b/contractgen/src/test/projects/demo/pom.xml
index a20e1cc..40e1b1e 100755
--- a/contractgen/src/test/projects/demo/pom.xml
+++ b/contractgen/src/test/projects/demo/pom.xml
@@ -1,32 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
- Copyright 2014 Linagora, Université Joseph Fourier
- 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.
+ ~ 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.
-->
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <prerequisites>
- <maven>3.0.3</maven>
- </prerequisites>
-
<groupId>org.apache.servicecomb.toolkit</groupId>
- <artifactId>this-is-for-test-only</artifactId>
+ <artifactId>demo</artifactId>
<version>0.1.0-SNAPSHOT</version>
- <name>This is for Test ONLY</name>
+ <name>demo-contractgen-test</name>
<packaging>jar</packaging>
<parent>
diff --git a/toolkit-maven-plugin/src/test/projects/demo-with-contract/pom-gencontract.xml b/toolkit-maven-plugin/src/test/projects/demo-with-contract/pom-gencontract.xml
deleted file mode 100755
index 2999e45..0000000
--- a/toolkit-maven-plugin/src/test/projects/demo-with-contract/pom-gencontract.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright 2014 Linagora, Université Joseph Fourier
- 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.
- -->
-
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <prerequisites>
- <maven>3.0.3</maven>
- </prerequisites>
-
- <groupId>org.apache.servicecomb.toolkit</groupId>
- <artifactId>this-is-for-test-only</artifactId>
- <version>0.1.0-SNAPSHOT</version>
- <name>This is for Test ONLY</name>
- <packaging>jar</packaging>
-
- <parent>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>1.5.12.RELEASE</version>
- <relativePath/> <!-- lookup parent from repository -->
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.servicecomb.toolkit</groupId>
- <artifactId>toolkit-maven-plugin</artifactId>
- <version>${project.version}</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
diff --git a/toolkit-maven-plugin/src/test/projects/demo-with-contract/pom.xml b/toolkit-maven-plugin/src/test/projects/demo-with-contract/pom.xml
index 66bc85f..c5c13f7 100755
--- a/toolkit-maven-plugin/src/test/projects/demo-with-contract/pom.xml
+++ b/toolkit-maven-plugin/src/test/projects/demo-with-contract/pom.xml
@@ -1,32 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
- Copyright 2014 Linagora, Université Joseph Fourier
- 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.
+ ~ 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.
-->
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <prerequisites>
- <maven>3.0.3</maven>
- </prerequisites>
-
<groupId>org.apache.servicecomb.toolkit</groupId>
- <artifactId>this-is-for-test-only</artifactId>
+ <artifactId>demo-with-contract</artifactId>
<version>0.1.0-SNAPSHOT</version>
- <name>This is for Test ONLY</name>
+ <name>demo-with-contract-test</name>
<packaging>jar</packaging>
<parent>
diff --git a/toolkit-maven-plugin/src/test/projects/demo-without-contract/pom-gencontract.xml b/toolkit-maven-plugin/src/test/projects/demo-without-contract/pom-gencontract.xml
deleted file mode 100755
index c6adc8e..0000000
--- a/toolkit-maven-plugin/src/test/projects/demo-without-contract/pom-gencontract.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright 2014 Linagora, Université Joseph Fourier
- 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.
- -->
-
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <prerequisites>
- <maven>3.0.3</maven>
- </prerequisites>
-
- <groupId>org.apache.servicecomb.toolkit</groupId>
- <artifactId>this-is-for-test-only</artifactId>
- <version>0.1.0-SNAPSHOT</version>
- <name>This is for Test ONLY</name>
- <packaging>jar</packaging>
-
- <parent>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>1.5.12.RELEASE</version>
- <relativePath/> <!-- lookup parent from repository -->
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.servicecomb.toolkit</groupId>
- <artifactId>toolkit-maven-plugin</artifactId>
- <version>${project.version}</version>
- <extensions>true</extensions>
- <configuration>
- <outputDir>target/test_output_contracts</outputDir>
- <format>.yaml</format>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
diff --git a/toolkit-maven-plugin/src/test/projects/demo-without-contract/pom.xml b/toolkit-maven-plugin/src/test/projects/demo-without-contract/pom.xml
index d5d8cea..5058438 100755
--- a/toolkit-maven-plugin/src/test/projects/demo-without-contract/pom.xml
+++ b/toolkit-maven-plugin/src/test/projects/demo-without-contract/pom.xml
@@ -1,32 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
- Copyright 2014 Linagora, Université Joseph Fourier
- 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.
+ ~ 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.
-->
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <prerequisites>
- <maven>3.0.3</maven>
- </prerequisites>
-
<groupId>org.apache.servicecomb.toolkit</groupId>
- <artifactId>this-is-for-test-only</artifactId>
+ <artifactId>demo-without-contract</artifactId>
<version>0.1.0-SNAPSHOT</version>
- <name>This is for Test ONLY</name>
+ <name>demo-without-contract-test</name>
<packaging>jar</packaging>
<parent>