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 75381e345e4f8a65fd12e6ecff9b4487af9e3e70 Author: liubao <[email protected]> AuthorDate: Wed Jul 25 09:55:59 2018 +0800 [SCB-772]fix more tests and change IT log level to WARN to meet 4MB log limit --- .../core/definition/schema/TestConsumerSchemaFactory.java | 3 +-- .../client/tcp/TestAbstractTcpClientPoolFactory.java | 15 +++++---------- .../{log4j.properties => config/log4j.z.properties} | 3 ++- .../src/test/resources/config/log4j.z.properties} | 3 ++- .../{log4j.properties => config/log4j.z.properties} | 3 ++- .../src/test/resources/log4j.properties | 2 +- .../src/test/resources/log4j.properties | 2 +- .../src/test/resources/log4j.properties | 2 +- .../src/test/resources/log4j.properties | 2 +- .../src/test/resources/log4j.properties | 2 +- .../src/test/resources/config/log4j.z.properties} | 3 ++- .../apache/servicecomb/tests/tracing/TracingTestMain.java | 4 +++- .../src/test/resources/config/log4j.z.properties} | 3 ++- 13 files changed, 24 insertions(+), 23 deletions(-) diff --git a/core/src/test/java/org/apache/servicecomb/core/definition/schema/TestConsumerSchemaFactory.java b/core/src/test/java/org/apache/servicecomb/core/definition/schema/TestConsumerSchemaFactory.java index 4863e38..ec59bd7 100644 --- a/core/src/test/java/org/apache/servicecomb/core/definition/schema/TestConsumerSchemaFactory.java +++ b/core/src/test/java/org/apache/servicecomb/core/definition/schema/TestConsumerSchemaFactory.java @@ -27,8 +27,6 @@ import org.junit.Assert; import org.junit.Test; public class TestConsumerSchemaFactory { - private static UnitTestMeta meta = new UnitTestMeta(); - class TestConsumerSchemaFactoryImpl { public int add(int x, int y) { return x + y; @@ -37,6 +35,7 @@ public class TestConsumerSchemaFactory { @Test public void createConsumerSchema() { + UnitTestMeta meta = new UnitTestMeta(); meta.registerSchema(new PojoSwaggerGeneratorContext(), TestConsumerSchemaFactoryImpl.class); MicroserviceVersionRule microserviceVersionRule = meta.getServiceRegistry().getAppManager() diff --git a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/client/tcp/TestAbstractTcpClientPoolFactory.java b/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/client/tcp/TestAbstractTcpClientPoolFactory.java index a95aa3f..9c7dc36 100644 --- a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/client/tcp/TestAbstractTcpClientPoolFactory.java +++ b/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/client/tcp/TestAbstractTcpClientPoolFactory.java @@ -18,12 +18,10 @@ package org.apache.servicecomb.foundation.vertx.client.tcp; import org.junit.Assert; import org.junit.Test; +import org.mockito.Mockito; import io.vertx.core.Context; import io.vertx.core.Vertx; -import io.vertx.core.impl.VertxImpl; -import mockit.Expectations; -import mockit.Mocked; public class TestAbstractTcpClientPoolFactory { private TcpClientConfig normalClientConfig = new TcpClientConfig(); @@ -33,13 +31,10 @@ public class TestAbstractTcpClientPoolFactory { TcpClientPoolFactory factory = new TcpClientPoolFactory(normalClientConfig, sslClientConfig); @Test - public void createClientPool(@Mocked Vertx vertx, @Mocked Context context) { - new Expectations(VertxImpl.class) { - { - context.owner(); - result = vertx; - } - }; + public void createClientPool() { + Vertx vertx = Mockito.mock(Vertx.class); + Context context = Mockito.mock(Context.class); + Mockito.when(context.owner()).thenReturn(vertx); TcpClientConnectionPool pool = factory.createClientPool(context); Assert.assertSame(normalClientConfig, pool.netClientWrapper.getClientConfig(false)); diff --git a/integration-tests/dynamic-config-tests/src/test/resources/log4j.properties b/integration-tests/dynamic-config-tests/src/test/resources/config/log4j.z.properties similarity index 92% copy from integration-tests/dynamic-config-tests/src/test/resources/log4j.properties copy to integration-tests/dynamic-config-tests/src/test/resources/config/log4j.z.properties index ba21655..5520c46 100644 --- a/integration-tests/dynamic-config-tests/src/test/resources/log4j.properties +++ b/integration-tests/dynamic-config-tests/src/test/resources/config/log4j.z.properties @@ -14,4 +14,5 @@ # See the License for the specific language governing permissions and # limitations under the License. # -log4j.rootLogger=INFO \ No newline at end of file +log4j.logger.runLogger=WARN +log4j.rootLogger=WARN,paas,stdout \ No newline at end of file diff --git a/integration-tests/dynamic-config-tests/src/test/resources/log4j.properties b/integration-tests/jaxrs-tests/src/test/resources/config/log4j.z.properties similarity index 92% rename from integration-tests/dynamic-config-tests/src/test/resources/log4j.properties rename to integration-tests/jaxrs-tests/src/test/resources/config/log4j.z.properties index ba21655..5520c46 100644 --- a/integration-tests/dynamic-config-tests/src/test/resources/log4j.properties +++ b/integration-tests/jaxrs-tests/src/test/resources/config/log4j.z.properties @@ -14,4 +14,5 @@ # See the License for the specific language governing permissions and # limitations under the License. # -log4j.rootLogger=INFO \ No newline at end of file +log4j.logger.runLogger=WARN +log4j.rootLogger=WARN,paas,stdout \ No newline at end of file diff --git a/integration-tests/pojo-test/src/test/resources/log4j.properties b/integration-tests/pojo-test/src/test/resources/config/log4j.z.properties similarity index 94% rename from integration-tests/pojo-test/src/test/resources/log4j.properties rename to integration-tests/pojo-test/src/test/resources/config/log4j.z.properties index bc03e25..02401e6 100644 --- a/integration-tests/pojo-test/src/test/resources/log4j.properties +++ b/integration-tests/pojo-test/src/test/resources/config/log4j.z.properties @@ -14,7 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -log4j.rootLogger=INFO, stdout +log4j.logger.runLogger=WARN +log4j.rootLogger=WARN,paas,stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n diff --git a/integration-tests/spring-jaxrs-tests/src/test/resources/log4j.properties b/integration-tests/spring-jaxrs-tests/src/test/resources/log4j.properties index 63aad6d..e5addd9 100644 --- a/integration-tests/spring-jaxrs-tests/src/test/resources/log4j.properties +++ b/integration-tests/spring-jaxrs-tests/src/test/resources/log4j.properties @@ -15,7 +15,7 @@ # limitations under the License. # -log4j.rootLogger=INFO, stdout +log4j.rootLogger=WARN, stdout # CONSOLE appender not used by default log4j.appender.stdout=org.apache.log4j.ConsoleAppender diff --git a/integration-tests/spring-jaxrs-tests/src/test/resources/log4j.properties b/integration-tests/spring-pojo-tests/src/test/resources/log4j.properties similarity index 97% copy from integration-tests/spring-jaxrs-tests/src/test/resources/log4j.properties copy to integration-tests/spring-pojo-tests/src/test/resources/log4j.properties index 63aad6d..e5addd9 100644 --- a/integration-tests/spring-jaxrs-tests/src/test/resources/log4j.properties +++ b/integration-tests/spring-pojo-tests/src/test/resources/log4j.properties @@ -15,7 +15,7 @@ # limitations under the License. # -log4j.rootLogger=INFO, stdout +log4j.rootLogger=WARN, stdout # CONSOLE appender not used by default log4j.appender.stdout=org.apache.log4j.ConsoleAppender diff --git a/integration-tests/spring-jaxrs-tests/src/test/resources/log4j.properties b/integration-tests/spring-zuul-tracing-tests/src/test/resources/log4j.properties similarity index 97% copy from integration-tests/spring-jaxrs-tests/src/test/resources/log4j.properties copy to integration-tests/spring-zuul-tracing-tests/src/test/resources/log4j.properties index 63aad6d..e5addd9 100644 --- a/integration-tests/spring-jaxrs-tests/src/test/resources/log4j.properties +++ b/integration-tests/spring-zuul-tracing-tests/src/test/resources/log4j.properties @@ -15,7 +15,7 @@ # limitations under the License. # -log4j.rootLogger=INFO, stdout +log4j.rootLogger=WARN, stdout # CONSOLE appender not used by default log4j.appender.stdout=org.apache.log4j.ConsoleAppender diff --git a/integration-tests/springmvc-tests/springmvc-tests-general-with-springboot/src/test/resources/log4j.properties b/integration-tests/springmvc-tests/springmvc-tests-general-with-springboot/src/test/resources/log4j.properties index bc03e25..705b2f7 100644 --- a/integration-tests/springmvc-tests/springmvc-tests-general-with-springboot/src/test/resources/log4j.properties +++ b/integration-tests/springmvc-tests/springmvc-tests-general-with-springboot/src/test/resources/log4j.properties @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -log4j.rootLogger=INFO, stdout +log4j.rootLogger=WARN, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n diff --git a/integration-tests/springmvc-tests/springmvc-tests-simplified-mapping-with-springboot/src/test/resources/log4j.properties b/integration-tests/springmvc-tests/springmvc-tests-simplified-mapping-with-springboot/src/test/resources/log4j.properties index bc03e25..705b2f7 100644 --- a/integration-tests/springmvc-tests/springmvc-tests-simplified-mapping-with-springboot/src/test/resources/log4j.properties +++ b/integration-tests/springmvc-tests/springmvc-tests-simplified-mapping-with-springboot/src/test/resources/log4j.properties @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -log4j.rootLogger=INFO, stdout +log4j.rootLogger=WARN, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n diff --git a/integration-tests/springmvc-tests/springmvc-tests-general-with-springboot/src/test/resources/log4j.properties b/integration-tests/springmvc-tests/springmvc-tests-simplified-mapping/src/test/resources/config/log4j.z.properties similarity index 94% copy from integration-tests/springmvc-tests/springmvc-tests-general-with-springboot/src/test/resources/log4j.properties copy to integration-tests/springmvc-tests/springmvc-tests-simplified-mapping/src/test/resources/config/log4j.z.properties index bc03e25..02401e6 100644 --- a/integration-tests/springmvc-tests/springmvc-tests-general-with-springboot/src/test/resources/log4j.properties +++ b/integration-tests/springmvc-tests/springmvc-tests-simplified-mapping/src/test/resources/config/log4j.z.properties @@ -14,7 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -log4j.rootLogger=INFO, stdout +log4j.logger.runLogger=WARN +log4j.rootLogger=WARN,paas,stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n diff --git a/integration-tests/tracing-tests/src/test/java/org/apache/servicecomb/tests/tracing/TracingTestMain.java b/integration-tests/tracing-tests/src/test/java/org/apache/servicecomb/tests/tracing/TracingTestMain.java index ec12a81..9969c2d 100644 --- a/integration-tests/tracing-tests/src/test/java/org/apache/servicecomb/tests/tracing/TracingTestMain.java +++ b/integration-tests/tracing-tests/src/test/java/org/apache/servicecomb/tests/tracing/TracingTestMain.java @@ -18,10 +18,12 @@ package org.apache.servicecomb.tests.tracing; import org.apache.servicecomb.foundation.common.utils.BeanUtils; +import org.apache.servicecomb.foundation.common.utils.Log4jUtils; public class TracingTestMain { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { + Log4jUtils.init(); BeanUtils.init(); } } diff --git a/integration-tests/springmvc-tests/springmvc-tests-general-with-springboot/src/test/resources/log4j.properties b/integration-tests/tracing-tests/src/test/resources/config/log4j.z.properties similarity index 94% copy from integration-tests/springmvc-tests/springmvc-tests-general-with-springboot/src/test/resources/log4j.properties copy to integration-tests/tracing-tests/src/test/resources/config/log4j.z.properties index bc03e25..02401e6 100644 --- a/integration-tests/springmvc-tests/springmvc-tests-general-with-springboot/src/test/resources/log4j.properties +++ b/integration-tests/tracing-tests/src/test/resources/config/log4j.z.properties @@ -14,7 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -log4j.rootLogger=INFO, stdout +log4j.logger.runLogger=WARN +log4j.rootLogger=WARN,paas,stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
