From f8cad425d15d5186558804ad0197e3787b39636a Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 25 Jun 2019 15:47:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E4=BB=BB=E5=8A=A1=EF=BC=8C=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/help/TutorialActionTest.java | 3 ++- .../mainframe/template/info/TemplateInfoCollectorTest.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/designer-base/src/test/java/com/fr/design/actions/help/TutorialActionTest.java b/designer-base/src/test/java/com/fr/design/actions/help/TutorialActionTest.java index 7e4dad651..dc1e871b4 100644 --- a/designer-base/src/test/java/com/fr/design/actions/help/TutorialActionTest.java +++ b/designer-base/src/test/java/com/fr/design/actions/help/TutorialActionTest.java @@ -7,7 +7,7 @@ import junit.framework.TestCase; import java.util.Locale; import java.util.UUID; -public class TutorialActionTest extends TestCase{ +public class TutorialActionTest extends TestCase { public void testCreateKey() { TutorialAction action = new TutorialAction(); @@ -24,6 +24,7 @@ public class TutorialActionTest extends TestCase{ GeneralContext.setLocale(pt); String ptKey = action.createDocKey(); assertTrue(ptKey.contains(pt.toString())); + GeneralContext.setLocale(Locale.CHINA); } public void testServerOnline() { diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java index e83a523fc..d93a7476a 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java @@ -56,6 +56,8 @@ public class TemplateInfoCollectorTest { initialFileContent = FileUtils.readFileToString(new File(filePath), "utf-8"); Reflect.on(TemplateInfoCollector.class).set("instance", null); + // 后执行 testReadXML 用例时,之前保留的单例会造成影响 + Reflect.on(DesignerOpenHistory.class).set("singleton", null); } @After @@ -89,7 +91,7 @@ public class TemplateInfoCollectorTest { assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + "\"cell_count\":13,\"block_count\":3,\"report_type\":0," + - "\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\"}",templateInfo.getProcessMapJsonString()); + "\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\"}", templateInfo.getProcessMapJsonString()); assertJsonStringEquals("{\"activitykey\":\"2e0ea413-fa9c241e0-9723-4354fce51e81\"," + "\"jar_time\":\"不是安装版本\",\"create_time\":\"2019-03-26 16:13\"," + @@ -118,7 +120,7 @@ public class TemplateInfoCollectorTest { assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + "\"cell_count\":13,\"block_count\":3,\"report_type\":0," + - "\"templateID\":\"73a97777-8jnk-47cd-b57c-2ee89991279796\"}",templateInfo.getProcessMapJsonString()); + "\"templateID\":\"73a97777-8jnk-47cd-b57c-2ee89991279796\"}", templateInfo.getProcessMapJsonString()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); assertEquals(templateID, consumingMap.get("templateID"));