reduce test log
Signed-off-by: kakulisen <18813972746@163.com>
diff --git a/cli/pom.xml b/cli/pom.xml
index 4499804..00618bf 100644
--- a/cli/pom.xml
+++ b/cli/pom.xml
@@ -30,7 +30,7 @@
<properties>
<main.class>org.apache.servicecomb.toolkit.cli.ToolkitMain</main.class>
- <log4j2.version>2.11.0</log4j2.version>
+ <log4j2.version>2.3</log4j2.version>
</properties>
<dependencies>
diff --git a/cli/src/test/resources/log4j2-test.xml b/cli/src/test/resources/log4j2-test.xml
new file mode 100755
index 0000000..c085ac3
--- /dev/null
+++ b/cli/src/test/resources/log4j2-test.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!--this is sample configuration, please modify as your wish-->
+
+<configuration>
+ <loggers>
+ <logger name="org.openapitools" additivity="false" level="OFF">
+ </logger>
+ </loggers>
+</configuration>
\ No newline at end of file
diff --git a/codegen/pom.xml b/codegen/pom.xml
index 8871d42..4963938 100644
--- a/codegen/pom.xml
+++ b/codegen/pom.xml
@@ -34,6 +34,7 @@
<swagger-codegen-version>2.4.3</swagger-codegen-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.8.1</junit-version>
+ <log4j2.version>2.3</log4j2.version>
</properties>
<dependencies>
@@ -55,10 +56,38 @@
<groupId>com.google.guava</groupId>
<artifactId>listenablefuture</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+
+ <dependency><!-- 桥接:告诉commons logging使用Log4j2 -->
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-jcl</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
diff --git a/codegen/src/test/resources/log4j2-test.xml b/codegen/src/test/resources/log4j2-test.xml
new file mode 100755
index 0000000..c085ac3
--- /dev/null
+++ b/codegen/src/test/resources/log4j2-test.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!--this is sample configuration, please modify as your wish-->
+
+<configuration>
+ <loggers>
+ <logger name="org.openapitools" additivity="false" level="OFF">
+ </logger>
+ </loggers>
+</configuration>
\ No newline at end of file
diff --git a/contractgen/src/test/resources/log4j2-test.xml b/contractgen/src/test/resources/log4j2-test.xml
new file mode 100755
index 0000000..59976dc
--- /dev/null
+++ b/contractgen/src/test/resources/log4j2-test.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!--this is sample configuration, please modify as your wish-->
+
+<configuration>
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT">
+ <PatternLayout pattern="%m%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="info">
+ <AppenderRef ref="Console"/>
+ </Root>
+ <Logger name="org.openapitools" additivity="false" level="ERROR">
+ <AppenderRef ref="Console"/>
+ </Logger>
+ </Loggers>
+</configuration>
\ No newline at end of file
diff --git a/oas-generator/oas-generator-jaxrs/src/test/java/org/apache/servicecomb/toolkit/generator/JaxrsParserTest.java b/oas-generator/oas-generator-jaxrs/src/test/java/org/apache/servicecomb/toolkit/generator/JaxrsParserTest.java
index 2591de4..27ef273 100644
--- a/oas-generator/oas-generator-jaxrs/src/test/java/org/apache/servicecomb/toolkit/generator/JaxrsParserTest.java
+++ b/oas-generator/oas-generator-jaxrs/src/test/java/org/apache/servicecomb/toolkit/generator/JaxrsParserTest.java
@@ -56,12 +56,4 @@
return "no resource";
}
}
-
- public static void main(String[] args) {
- OneResource.class.getMethods();
- Components components1 = new Components();
- Components components2 = new Components();
-
- System.out.println(components1.equals(components2));
- }
}
diff --git a/toolkit-maven-plugin/src/test/java/org/apache/servicecomb/toolkit/plugin/InvokeStaticMethodTest.java b/toolkit-maven-plugin/src/test/java/org/apache/servicecomb/toolkit/plugin/InvokeStaticMethodTest.java
index e66cd70..8c9aab1 100755
--- a/toolkit-maven-plugin/src/test/java/org/apache/servicecomb/toolkit/plugin/InvokeStaticMethodTest.java
+++ b/toolkit-maven-plugin/src/test/java/org/apache/servicecomb/toolkit/plugin/InvokeStaticMethodTest.java
@@ -41,11 +41,13 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
@RunWith(PowerMockRunner.class)
@PrepareForTest({FileUtils.class, GenerateUtil.class})
+@PowerMockIgnore({"javax.management.*"})
public class InvokeStaticMethodTest {
@Rule
diff --git a/toolkit-maven-plugin/src/test/resources/log4j2-test.xml b/toolkit-maven-plugin/src/test/resources/log4j2-test.xml
new file mode 100755
index 0000000..c085ac3
--- /dev/null
+++ b/toolkit-maven-plugin/src/test/resources/log4j2-test.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!--this is sample configuration, please modify as your wish-->
+
+<configuration>
+ <loggers>
+ <logger name="org.openapitools" additivity="false" level="OFF">
+ </logger>
+ </loggers>
+</configuration>
\ No newline at end of file