Merge branch 'apache-3.2' into apache-3.3
# Conflicts: # dubbo-distribution/dubbo-apache-release/pom.xml # dubbo-spring-boot/pom.xml
This commit is contained in:
commit
9b3a32f8d6
|
|
@ -242,7 +242,7 @@
|
|||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>testcontainers</artifactId>
|
||||
<version>1.19.6</version>
|
||||
<version>1.19.7</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@
|
|||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-core</artifactId>
|
||||
<version>1.5.2</version>
|
||||
<version>1.5.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@
|
|||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-core</artifactId>
|
||||
<version>1.5.2</version>
|
||||
<version>1.5.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@
|
|||
<log4j_version>1.2.17</log4j_version>
|
||||
<logback_version>1.2.13</logback_version>
|
||||
<!-- Fix the bug of log4j refer:https://github.com/apache/logging-log4j2/pull/608 -->
|
||||
<log4j2_version>2.23.0</log4j2_version>
|
||||
<log4j2_version>2.23.1</log4j2_version>
|
||||
<commons_io_version>2.15.1</commons_io_version>
|
||||
<commons-codec_version>1.16.0</commons-codec_version>
|
||||
|
||||
|
|
@ -166,7 +166,7 @@
|
|||
|
||||
<jaxb_version>2.2.7</jaxb_version>
|
||||
<activation_version>1.2.0</activation_version>
|
||||
<test_container_version>1.19.6</test_container_version>
|
||||
<test_container_version>1.19.7</test_container_version>
|
||||
<hessian_lite_version>3.2.13</hessian_lite_version>
|
||||
<swagger_version>1.6.13</swagger_version>
|
||||
|
||||
|
|
@ -175,11 +175,11 @@
|
|||
<sofa_registry_version>5.4.3</sofa_registry_version>
|
||||
<metrics_version>2.0.6</metrics_version>
|
||||
<gson_version>2.10.1</gson_version>
|
||||
<jackson_version>2.16.1</jackson_version>
|
||||
<jackson_version>2.16.2</jackson_version>
|
||||
<mortbay_jetty_version>6.1.26</mortbay_jetty_version>
|
||||
<portlet_version>2.0</portlet_version>
|
||||
<maven_flatten_version>1.6.0</maven_flatten_version>
|
||||
<commons_compress_version>1.26.0</commons_compress_version>
|
||||
<commons_compress_version>1.26.1</commons_compress_version>
|
||||
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
|
||||
<spotless.action>check</spotless.action>
|
||||
<dubbo-shared-resources.version>1.0.0</dubbo-shared-resources.version>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.7.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bin</id>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,8 @@ public class ChangeTelnet implements BaseCommand {
|
|||
for (Exporter<?> exporter : dubboProtocol.getExporters()) {
|
||||
if (message.equals(exporter.getInvoker().getInterface().getSimpleName())
|
||||
|| message.equals(exporter.getInvoker().getInterface().getName())
|
||||
|| message.equals(exporter.getInvoker().getUrl().getPath())) {
|
||||
|| message.equals(exporter.getInvoker().getUrl().getPath())
|
||||
|| message.equals(exporter.getInvoker().getUrl().getServiceKey())) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,8 @@ public class CountTelnet implements BaseCommand {
|
|||
for (Exporter<?> exporter : dubboProtocol.getExporters()) {
|
||||
if (service.equals(exporter.getInvoker().getInterface().getSimpleName())
|
||||
|| service.equals(exporter.getInvoker().getInterface().getName())
|
||||
|| service.equals(exporter.getInvoker().getUrl().getPath())) {
|
||||
|| service.equals(exporter.getInvoker().getUrl().getPath())
|
||||
|| service.equals(exporter.getInvoker().getUrl().getServiceKey())) {
|
||||
invoker = exporter.getInvoker();
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class ChangeTelnetTest {
|
|||
mockChannel.attr(ChangeTelnet.SERVICE_KEY).set("org.apache.dubbo.rpc.protocol.dubbo.support.DemoService");
|
||||
given(mockCommandContext.getRemote()).willReturn(mockChannel);
|
||||
given(mockInvoker.getInterface()).willReturn(DemoService.class);
|
||||
given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20884/demo"));
|
||||
given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20884/demo?group=g&version=1.0.0"));
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
|
|
@ -110,6 +110,15 @@ class ChangeTelnetTest {
|
|||
assertEquals("Used the demo as default.\r\nYou can cancel default service by command: cd /", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testChangeServiceKey() {
|
||||
ExtensionLoader.getExtensionLoader(Protocol.class)
|
||||
.getExtension(DubboProtocol.NAME)
|
||||
.export(mockInvoker);
|
||||
String result = change.execute(mockCommandContext, new String[] {"g/demo:1.0.0"});
|
||||
assertEquals("Used the g/demo:1.0.0 as default.\r\nYou can cancel default service by command: cd /", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testChangeMessageNull() {
|
||||
String result = change.execute(mockCommandContext, null);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class CountTelnetTest {
|
|||
private CommandContext mockCommandContext;
|
||||
|
||||
private CountDownLatch latch;
|
||||
private final URL url = URL.valueOf("dubbo://127.0.0.1:20884/demo");
|
||||
private final URL url = URL.valueOf("dubbo://127.0.0.1:20884/demo?group=g&version=1.0.0");
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
|
|
@ -70,12 +70,14 @@ class CountTelnetTest {
|
|||
public void tearDown() {
|
||||
FrameworkModel.destroyAll();
|
||||
mockChannel.close();
|
||||
RpcStatus.removeStatus(url);
|
||||
reset(mockInvoker, mockCommandContext);
|
||||
}
|
||||
|
||||
@Test
|
||||
void test() throws Exception {
|
||||
String methodName = "sayHello";
|
||||
RpcStatus.removeStatus(url, methodName);
|
||||
String[] args = new String[] {"org.apache.dubbo.qos.legacy.service.DemoService", "sayHello", "1"};
|
||||
|
||||
ExtensionLoader.getExtensionLoader(Protocol.class)
|
||||
|
|
@ -94,6 +96,28 @@ class CountTelnetTest {
|
|||
assertThat(sb.toString(), containsString(buildTable(methodName, 10, 10, "1", "0", "0")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCountByServiceKey() throws Exception {
|
||||
String methodName = "sayHello";
|
||||
RpcStatus.removeStatus(url, methodName);
|
||||
String[] args = new String[] {"g/demo:1.0.0", "sayHello", "1"};
|
||||
|
||||
ExtensionLoader.getExtensionLoader(Protocol.class)
|
||||
.getExtension(DubboProtocol.NAME)
|
||||
.export(mockInvoker);
|
||||
RpcStatus.beginCount(url, methodName);
|
||||
RpcStatus.endCount(url, methodName, 10L, true);
|
||||
count.execute(mockCommandContext, args);
|
||||
latch.await();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Object o : mockChannel.getReceivedObjects()) {
|
||||
sb.append(o.toString());
|
||||
}
|
||||
|
||||
assertThat(sb.toString(), containsString(buildTable(methodName, 10, 10, "1", "0", "0")));
|
||||
}
|
||||
|
||||
public static String buildTable(
|
||||
String methodName, long averageElapsed, long maxElapsed, String total, String failed, String active) {
|
||||
List<String> header = new LinkedList<>();
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<curator.test.version>4.2.0</curator.test.version>
|
||||
<zookeeper.version>3.7.2</zookeeper.version>
|
||||
<curator5.version>4.2.0</curator5.version>
|
||||
<commons.compress.version>1.26.0</commons.compress.version>
|
||||
<commons.compress.version>1.26.1</commons.compress.version>
|
||||
<junit.platform.launcher.version>1.9.3</junit.platform.launcher.version>
|
||||
<commons.exec.version>1.4.0</commons.exec.version>
|
||||
<async.http.client.version>2.12.3</async.http.client.version>
|
||||
|
|
|
|||
Loading…
Reference in New Issue