Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@
DubboConfigBeanInitializerTest.class,
DubboConfigBeanInitializerTest.AppConfiguration.class,
})
@TestPropertySource(properties = {"dubbo.protocol.port=-1", "dubbo.registry.address=${zookeeper.connection.address}"})
@TestPropertySource(
properties = {
"dubbo.protocol.port=-1",
"dubbo.registry.address=${zookeeper.connection.address}",
"dubbo.metrics.enabled = false",
"dubbo.metrics.protocol = disabled"
})
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
class DubboConfigBeanInitializerTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,32 @@
*/
package org.apache.dubbo.config.spring.reference.registryNA.consumer;

import org.apache.dubbo.config.bootstrap.DubboBootstrap;
import org.apache.dubbo.config.spring.SysProps;
import org.apache.dubbo.config.spring.api.HelloService;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

class DubboXmlConsumerTest {

@BeforeEach
void setUp() {
DubboBootstrap.reset();
SysProps.clear();
SysProps.setProperty("dubbo.metrics.enabled", "false");
SysProps.setProperty("dubbo.metrics.protocol", "disabled");
}

@AfterEach
void tearDown() {
DubboBootstrap.reset();
SysProps.clear();
}

@Test
void testConsumer() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.springframework.context.annotation.ImportResource;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand All @@ -42,6 +43,7 @@
@ContextConfiguration(classes = GenericServiceTest.class)
@DirtiesContext(classMode = AFTER_EACH_TEST_METHOD)
@ImportResource(locations = "classpath:/META-INF/spring/dubbo-generic-consumer.xml")
@TestPropertySource(properties = {"dubbo.metrics.enabled = false", "dubbo.metrics.protocol = disabled"})
class GenericServiceTest {

@BeforeAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.springframework.context.annotation.ImportResource;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD;
Expand All @@ -39,6 +40,7 @@
@ContextConfiguration(classes = GenericServiceWithoutInterfaceTest.class)
@DirtiesContext(classMode = AFTER_EACH_TEST_METHOD)
@ImportResource(locations = "classpath:/META-INF/spring/dubbo-generic-consumer-without-interface.xml")
@TestPropertySource(properties = {"dubbo.metrics.enabled = false", "dubbo.metrics.protocol = disabled"})
class GenericServiceWithoutInterfaceTest {

@BeforeAll
Expand Down
Loading