From 88cc365674fc211551c537a00fbf9fa4df15d110 Mon Sep 17 00:00:00 2001 From: Albumen Date: Fri, 12 Mar 2021 21:38:40 +0800 Subject: [PATCH] add test suite to make order --- .../apache/dubbo/spring/boot/TestSuite.java | 53 +++++++++++++++++++ .../CompatibleDubboAutoConfigurationTest.java | 3 +- ...ideDubboConfigApplicationListenerTest.java | 3 +- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/TestSuite.java rename dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/{ => autoconfigure}/CompatibleDubboAutoConfigurationTest.java (95%) diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/TestSuite.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/TestSuite.java new file mode 100644 index 000000000..f9106b90f --- /dev/null +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/TestSuite.java @@ -0,0 +1,53 @@ +/* + * 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.dubbo.spring.boot; + +import org.apache.dubbo.spring.boot.autoconfigure.CompatibleDubboAutoConfigurationTest; +import org.apache.dubbo.spring.boot.autoconfigure.CompatibleDubboAutoConfigurationTestWithoutProperties; +import org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfigurationOnMultipleConfigTest; +import org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfigurationOnSingleConfigTest; +import org.apache.dubbo.spring.boot.autoconfigure.RelaxedDubboConfigBinderTest; +import org.apache.dubbo.spring.boot.context.event.AwaitingNonWebApplicationListenerTest; +import org.apache.dubbo.spring.boot.context.event.DubboConfigBeanDefinitionConflictApplicationListenerTest; +import org.apache.dubbo.spring.boot.context.event.OverrideDubboConfigApplicationListenerDisableTest; +import org.apache.dubbo.spring.boot.context.event.OverrideDubboConfigApplicationListenerTest; +import org.apache.dubbo.spring.boot.context.event.WelcomeLogoApplicationListenerTest; +import org.apache.dubbo.spring.boot.env.DubboDefaultPropertiesEnvironmentPostProcessorTest; +import org.apache.dubbo.spring.boot.util.DubboUtilsTest; +import org.apache.dubbo.spring.boot.util.EnvironmentUtilsTest; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + CompatibleDubboAutoConfigurationTest.class, + CompatibleDubboAutoConfigurationTestWithoutProperties.class, + DubboAutoConfigurationOnMultipleConfigTest.class, + DubboAutoConfigurationOnSingleConfigTest.class, + RelaxedDubboConfigBinderTest.class, + AwaitingNonWebApplicationListenerTest.class, + DubboConfigBeanDefinitionConflictApplicationListenerTest.class, + OverrideDubboConfigApplicationListenerDisableTest.class, + OverrideDubboConfigApplicationListenerTest.class, + WelcomeLogoApplicationListenerTest.class, + DubboDefaultPropertiesEnvironmentPostProcessorTest.class, + DubboUtilsTest.class, + EnvironmentUtilsTest.class +}) +public class TestSuite { +} diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/CompatibleDubboAutoConfigurationTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/CompatibleDubboAutoConfigurationTest.java similarity index 95% rename from dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/CompatibleDubboAutoConfigurationTest.java rename to dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/CompatibleDubboAutoConfigurationTest.java index f0e5b745b..17dfe93f0 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/CompatibleDubboAutoConfigurationTest.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/autoconfigure/CompatibleDubboAutoConfigurationTest.java @@ -14,11 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dubbo.spring.boot; +package org.apache.dubbo.spring.boot.autoconfigure; import org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor; import org.apache.dubbo.config.spring.beans.factory.annotation.ServiceClassPostProcessor; -import org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration; import org.junit.Assert; import org.junit.Test; diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerTest.java b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerTest.java index 87ee1c35a..eb1e0aa3c 100644 --- a/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerTest.java +++ b/dubbo-spring-boot-compatible/autoconfigure/src/test/java/org/apache/dubbo/spring/boot/context/event/OverrideDubboConfigApplicationListenerTest.java @@ -25,6 +25,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; @@ -47,6 +48,7 @@ @SpringBootTest( classes = {OverrideDubboConfigApplicationListener.class} ) +@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD) public class OverrideDubboConfigApplicationListenerTest { @BeforeClass @@ -62,7 +64,6 @@ public static void destroy() { @Test public void testOnApplicationEvent() { - Properties properties = ConfigUtils.getProperties(); Assert.assertEquals("dubbo-demo-application", properties.get("dubbo.application.name"));