Browse Source

无任务,单元测试

research/10.0
yaoh.wu 5 years ago
parent
commit
f8cad425d1
  1. 3
      designer-base/src/test/java/com/fr/design/actions/help/TutorialActionTest.java
  2. 6
      designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java

3
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() {

6
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<String, Object> consumingMap = Reflect.on(templateInfo).field("consumingMap").get();
assertEquals(templateID, consumingMap.get("templateID"));

Loading…
Cancel
Save