Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PathEncoderManagerTest Bug. #11255

Closed
stone-98 opened this issue Oct 17, 2023 · 0 comments
Closed

PathEncoderManagerTest Bug. #11255

stone-98 opened this issue Oct 17, 2023 · 0 comments

Comments

@stone-98
Copy link
Contributor

stone-98 commented Oct 17, 2023

Describe the bug

@Test
public void testEncodeWithNonExistOs() {
System.setProperty("os.name", "non-exist");
String testCase = "aa||a";
Assert.assertEquals(testCase, PathEncoderManager.getInstance().encode(testCase));
}

System.setProperty("os.name", "non-exist");设置无效,导致unit test报错,如下:

image

原因:PathEncoderManager采用饿汉单例模式。调整为采用反射进行test。

stone-98 added a commit to stone-98/nacos that referenced this issue Oct 17, 2023
stone-98 added a commit to stone-98/nacos that referenced this issue Oct 17, 2023
KomachiSion pushed a commit that referenced this issue Oct 17, 2023
…#11256)

* [ISSUE #11255]Remove PathEncoderManagerTest#testEncodeWithNonExistOs.

* [ISSUE #11255]Update PathEncoderManagerTest#testEncodeWithNonExistOs.
stone-98 added a commit to stone-98/nacos that referenced this issue Oct 17, 2023
stone-98 added a commit to stone-98/nacos that referenced this issue Oct 17, 2023
stone-98 added a commit to stone-98/nacos that referenced this issue Oct 23, 2023
shiyiyue1102 pushed a commit that referenced this issue Oct 23, 2023
#11254)

* [ISSUE #11253]To fix the triggering of the listener upon failover content changes.

* [ISSUE #11255]Update style.

* [ISSUE #11255]Fix UdpConnectorTest#testContainAck.
lowezheng added a commit to lowezheng/nacos that referenced this issue Nov 12, 2023
* develop: (137 commits)
  Develop refactor topn (alibaba#11352)
  Develop fill ut common (alibaba#11335)
  Optimize MapperManager (alibaba#11195)
  Simplify the validate method for serviceinfo (alibaba#11312)
  add startup conditions (alibaba#11305)
  Fix some typos (alibaba#11269)
  fix: rename tar name (alibaba#11281)
  优化节点显示,添加mode (alibaba#11275)
  [ISSUE alibaba#11253]To fix the triggering of the listener upon failover con… (alibaba#11254)
  Add description for new plugin. (alibaba#11268)
  Upgrade to 2.3.0-BETA. (alibaba#11262)
  [ISSUE alibaba#11255]Update PathEncoderManagerTest#testEncodeWithNonExistOs. (alibaba#11256)
  Fill ut for common module (alibaba#11247)
  Optimize ThreadPoolManager (alibaba#11206)
  Fix npe when setup ack response in GrpcClient (alibaba#11210)
  [ISSUE#11192] batchRegisterInstance add recalculateRevision (alibaba#11232)
  feat(alibaba#11236): Remove invalid assertion in com.alibaba.nacos.config.server.service.ConfigCacheService#dumpChange. (alibaba#11237)
  feat(11115): http support cas publish. (alibaba#11120)
  [ISSUE alibaba#11231]Optimize the handleSpringBinder method in PropertiesUtil. (alibaba#11240)
  ISSUE alibaba#11212 (alibaba#11213)
  ...

# Conflicts:
#	console-ui/package-lock.json
#	console-ui/package.json
#	console-ui/src/pages/Login/Login.jsx
#	core/src/main/java/com/alibaba/nacos/core/listener/StartingApplicationListener.java
#	pom.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants