Browse Source

Pull request #2352: REPORT-38917 模板短时间内的保存记录对应多个UUID

Merge in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit '0c681257d3833dd97980153c77d1a1ef84962b2d':
  REPORT-38917 模板短时间内的保存记录对应多个UUID
  REPORT-38917 模板短时间内的保存记录对应多个UUID
feature/big-screen
Hades 4 years ago
parent
commit
b35f5693f4
  1. 5
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 8
      designer-base/src/test/java/com/fr/design/DesignerEnvManagerTest.java

5
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -1472,7 +1472,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
public String getUUID() { public String getUUID() {
return StringUtils.isEmpty(uuid) ? UUID.randomUUID().toString() : uuid; if (StringUtils.isEmpty(uuid)) {
uuid = UUID.randomUUID().toString();
}
return uuid;
} }
public int getActiveKeyStatus() { public int getActiveKeyStatus() {

8
designer-base/src/test/java/com/fr/design/DesignerEnvManagerTest.java

@ -3,6 +3,7 @@ package com.fr.design;
import junit.framework.TestCase; import junit.framework.TestCase;
import java.util.Locale; import java.util.Locale;
import org.junit.Assert;
public class DesignerEnvManagerTest extends TestCase{ public class DesignerEnvManagerTest extends TestCase{
@ -17,4 +18,11 @@ public class DesignerEnvManagerTest extends TestCase{
assertEquals("下边界", envManager.getLanguage(), Locale.SIMPLIFIED_CHINESE); assertEquals("下边界", envManager.getLanguage(), Locale.SIMPLIFIED_CHINESE);
} }
public void testGetUUID() {
DesignerEnvManager envManager = new DesignerEnvManager();
String uuid0 = envManager.getUUID();
String uuid1 = envManager.getUUID();
Assert.assertEquals(uuid0, uuid1);
}
} }

Loading…
Cancel
Save