This is an automated email from the ASF dual-hosted git repository.
huxing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 1706807 Changing tests to use singleton RegistryProtocol instead of
making new instances (#3849)
1706807 is described below
commit 1706807a1c9221fb13a24a8b318a56c699eea67d
Author: OrDTesters <[email protected]>
AuthorDate: Fri Apr 12 00:50:54 2019 -0500
Changing tests to use singleton RegistryProtocol instead of making new
instances (#3849)
---
.../org/apache/dubbo/registry/dubbo/RegistryProtocolTest.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/RegistryProtocolTest.java
b/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/RegistryProtocolTest.java
index f212a5c..f1669d3 100644
---
a/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/RegistryProtocolTest.java
+++
b/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/RegistryProtocolTest.java
@@ -61,14 +61,14 @@ public class RegistryProtocolTest {
@Test
public void testDefaultPort() {
- RegistryProtocol registryProtocol = new RegistryProtocol();
+ RegistryProtocol registryProtocol =
RegistryProtocol.getRegistryProtocol();
assertEquals(9090, registryProtocol.getDefaultPort());
}
@Test
public void testExportUrlNull() {
Assertions.assertThrows(IllegalArgumentException.class, () -> {
- RegistryProtocol registryProtocol = new RegistryProtocol();
+ RegistryProtocol registryProtocol =
RegistryProtocol.getRegistryProtocol();
registryProtocol.setCluster(new FailfastCluster());
Protocol dubboProtocol = DubboProtocol.getDubboProtocol();
@@ -81,7 +81,7 @@ public class RegistryProtocolTest {
@Test
public void testExport() {
- RegistryProtocol registryProtocol = new RegistryProtocol();
+ RegistryProtocol registryProtocol =
RegistryProtocol.getRegistryProtocol();
registryProtocol.setCluster(new FailfastCluster());
registryProtocol.setRegistryFactory(ExtensionLoader.getExtensionLoader(RegistryFactory.class).getAdaptiveExtension());
@@ -165,7 +165,7 @@ public class RegistryProtocolTest {
@Test
public void testGetParamsToRegistry() {
- RegistryProtocol registryProtocol = new RegistryProtocol();
+ RegistryProtocol registryProtocol =
RegistryProtocol.getRegistryProtocol();
String[] additionalParams = new String[]{"key1", "key2"};
String[] registryParams =
registryProtocol.getParamsToRegistry(DEFAULT_REGISTER_PROVIDER_KEYS,
additionalParams);
String[] expectParams =
ArrayUtils.addAll(DEFAULT_REGISTER_PROVIDER_KEYS, additionalParams);