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/08/01 07:39:07 UTC
[incubator-servicecomb-java-chassis] 03/03: SCB-687 simplify pojo
integration test
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 0e8664d57ecaba2f36cbbf2308b6d5c63dcf1c75
Author: zhengyangyong <ya...@huawei.com>
AuthorDate: Fri Jul 27 18:22:54 2018 +0800
SCB-687 simplify pojo integration test
Signed-off-by: zhengyangyong <ya...@huawei.com>
---
.../spring-pojo-connection-limit-test/pom.xml | 13 ---------
.../PojoSpringConnectionLimitIntegrationTest.java | 5 ++--
.../servicecomb/demo/pojo/test/PojoSpringMain.java | 31 ----------------------
.../src/test/resources/log4j.properties | 2 +-
integration-tests/spring-pojo-tests/pom.xml | 13 ---------
.../demo/pojo/test/PojoSpringIntegrationTest.java | 5 ++--
.../servicecomb/demo/pojo/test/PojoSpringMain.java | 31 ----------------------
7 files changed, 5 insertions(+), 95 deletions(-)
diff --git a/integration-tests/spring-pojo-connection-limit-test/pom.xml b/integration-tests/spring-pojo-connection-limit-test/pom.xml
index f121f62..b770bc2 100644
--- a/integration-tests/spring-pojo-connection-limit-test/pom.xml
+++ b/integration-tests/spring-pojo-connection-limit-test/pom.xml
@@ -44,25 +44,12 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-autoconfigure</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.servicecomb</groupId>
- <artifactId>spring-boot-starter-provider</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- </dependency>
-
</dependencies>
</project>
\ No newline at end of file
diff --git a/integration-tests/spring-pojo-connection-limit-test/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringConnectionLimitIntegrationTest.java b/integration-tests/spring-pojo-connection-limit-test/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringConnectionLimitIntegrationTest.java
index 69015c8..8c6d586 100644
--- a/integration-tests/spring-pojo-connection-limit-test/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringConnectionLimitIntegrationTest.java
+++ b/integration-tests/spring-pojo-connection-limit-test/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringConnectionLimitIntegrationTest.java
@@ -24,15 +24,14 @@ import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
-@SpringBootTest(classes = PojoSpringMain.class)
public class PojoSpringConnectionLimitIntegrationTest {
@BeforeClass
- public static void setUpClass() {
+ public static void setUpClass() throws Exception {
System.setProperty(LOCAL_REGISTRY_FILE_KEY, "notExistJustForceLocal");
+ PojoTestMain.main(null);
}
@Test
diff --git a/integration-tests/spring-pojo-connection-limit-test/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringMain.java b/integration-tests/spring-pojo-connection-limit-test/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringMain.java
deleted file mode 100644
index 1375571..0000000
--- a/integration-tests/spring-pojo-connection-limit-test/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringMain.java
+++ /dev/null
@@ -1,31 +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.demo.pojo.test;
-
-import org.apache.servicecomb.springboot.starter.provider.EnableServiceComb;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-@EnableServiceComb
-public class PojoSpringMain {
-
- public static void main(final String[] args) {
- SpringApplication.run(PojoSpringMain.class, args);
- }
-}
\ No newline at end of file
diff --git a/integration-tests/spring-pojo-connection-limit-test/src/test/resources/log4j.properties b/integration-tests/spring-pojo-connection-limit-test/src/test/resources/log4j.properties
index e18648a..8cc015c 100644
--- a/integration-tests/spring-pojo-connection-limit-test/src/test/resources/log4j.properties
+++ b/integration-tests/spring-pojo-connection-limit-test/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
\ No newline at end of file
diff --git a/integration-tests/spring-pojo-tests/pom.xml b/integration-tests/spring-pojo-tests/pom.xml
index 98e1fb3..f315502 100644
--- a/integration-tests/spring-pojo-tests/pom.xml
+++ b/integration-tests/spring-pojo-tests/pom.xml
@@ -44,25 +44,12 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-autoconfigure</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.servicecomb</groupId>
- <artifactId>spring-boot-starter-provider</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- </dependency>
-
</dependencies>
diff --git a/integration-tests/spring-pojo-tests/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringIntegrationTest.java b/integration-tests/spring-pojo-tests/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringIntegrationTest.java
index 749a4e5..bcd56e7 100644
--- a/integration-tests/spring-pojo-tests/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringIntegrationTest.java
+++ b/integration-tests/spring-pojo-tests/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringIntegrationTest.java
@@ -23,19 +23,18 @@ import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
-@SpringBootTest(classes = PojoSpringMain.class)
public class PojoSpringIntegrationTest extends PojoIntegrationTestBase {
private static final ConnectionEventWatcher watcher = new ConnectionEventWatcher();
@BeforeClass
- public static void setUpClass() {
+ public static void setUpClass() throws Exception {
setUpLocalRegistry();
EventManager.register(watcher);
+ PojoTestMain.main(null);
}
@AfterClass
diff --git a/integration-tests/spring-pojo-tests/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringMain.java b/integration-tests/spring-pojo-tests/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringMain.java
deleted file mode 100644
index a81656c..0000000
--- a/integration-tests/spring-pojo-tests/src/test/java/org/apache/servicecomb/demo/pojo/test/PojoSpringMain.java
+++ /dev/null
@@ -1,31 +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.demo.pojo.test;
-
-import org.apache.servicecomb.springboot.starter.provider.EnableServiceComb;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-@EnableServiceComb
-public class PojoSpringMain {
-
- public static void main(final String[] args) throws Exception {
- SpringApplication.run(PojoSpringMain.class, args);
- }
-}