File tree Expand file tree Collapse file tree 4 files changed +29
-1
lines changed
dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring Expand file tree Collapse file tree 4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 5151 DubboConfigBeanInitializerTest .class ,
5252 DubboConfigBeanInitializerTest .AppConfiguration .class ,
5353 })
54- @ TestPropertySource (properties = {"dubbo.protocol.port=-1" , "dubbo.registry.address=${zookeeper.connection.address}" })
54+ @ TestPropertySource (
55+ properties = {
56+ "dubbo.protocol.port=-1" ,
57+ "dubbo.registry.address=${zookeeper.connection.address}" ,
58+ "dubbo.metrics.enabled = false" ,
59+ "dubbo.metrics.protocol = disabled"
60+ })
5561@ EnableAspectJAutoProxy (proxyTargetClass = true , exposeProxy = true )
5662@ DirtiesContext (classMode = DirtiesContext .ClassMode .AFTER_EACH_TEST_METHOD )
5763class DubboConfigBeanInitializerTest {
Original file line number Diff line number Diff line change 1616 */
1717package org .apache .dubbo .config .spring .reference .registryNA .consumer ;
1818
19+ import org .apache .dubbo .config .bootstrap .DubboBootstrap ;
20+ import org .apache .dubbo .config .spring .SysProps ;
1921import org .apache .dubbo .config .spring .api .HelloService ;
2022
23+ import org .junit .jupiter .api .AfterEach ;
2124import org .junit .jupiter .api .Assertions ;
25+ import org .junit .jupiter .api .BeforeEach ;
2226import org .junit .jupiter .api .Test ;
2327import org .springframework .context .support .ClassPathXmlApplicationContext ;
2428
2529class DubboXmlConsumerTest {
2630
31+ @ BeforeEach
32+ void setUp () {
33+ DubboBootstrap .reset ();
34+ SysProps .clear ();
35+ SysProps .setProperty ("dubbo.metrics.enabled" , "false" );
36+ SysProps .setProperty ("dubbo.metrics.protocol" , "disabled" );
37+ }
38+
39+ @ AfterEach
40+ void tearDown () {
41+ DubboBootstrap .reset ();
42+ SysProps .clear ();
43+ }
44+
2745 @ Test
2846 void testConsumer () {
2947 ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext (
Original file line number Diff line number Diff line change 3333import org .springframework .context .annotation .ImportResource ;
3434import org .springframework .test .annotation .DirtiesContext ;
3535import org .springframework .test .context .ContextConfiguration ;
36+ import org .springframework .test .context .TestPropertySource ;
3637import org .springframework .test .context .junit .jupiter .SpringExtension ;
3738
3839import static org .junit .jupiter .api .Assertions .assertNotNull ;
4243@ ContextConfiguration (classes = GenericServiceTest .class )
4344@ DirtiesContext (classMode = AFTER_EACH_TEST_METHOD )
4445@ ImportResource (locations = "classpath:/META-INF/spring/dubbo-generic-consumer.xml" )
46+ @ TestPropertySource (properties = {"dubbo.metrics.enabled = false" , "dubbo.metrics.protocol = disabled" })
4547class GenericServiceTest {
4648
4749 @ BeforeAll
Original file line number Diff line number Diff line change 3131import org .springframework .context .annotation .ImportResource ;
3232import org .springframework .test .annotation .DirtiesContext ;
3333import org .springframework .test .context .ContextConfiguration ;
34+ import org .springframework .test .context .TestPropertySource ;
3435import org .springframework .test .context .junit .jupiter .SpringExtension ;
3536
3637import static org .springframework .test .annotation .DirtiesContext .ClassMode .AFTER_EACH_TEST_METHOD ;
3940@ ContextConfiguration (classes = GenericServiceWithoutInterfaceTest .class )
4041@ DirtiesContext (classMode = AFTER_EACH_TEST_METHOD )
4142@ ImportResource (locations = "classpath:/META-INF/spring/dubbo-generic-consumer-without-interface.xml" )
43+ @ TestPropertySource (properties = {"dubbo.metrics.enabled = false" , "dubbo.metrics.protocol = disabled" })
4244class GenericServiceWithoutInterfaceTest {
4345
4446 @ BeforeAll
You can’t perform that action at this time.
0 commit comments