Browse Source

REPORT-58833 js编辑器

feature/x
pengda 3 years ago
parent
commit
a6c350c17c
  1. 31
      designer-base/src/test/java/com/fr/design/javascript/jsapi/JSAPITreeHelperTest.java
  2. 17
      designer-base/src/test/resources/com/fr/design/javascript/jsapi/category.json
  3. 8
      designer-base/src/test/resources/com/fr/design/javascript/jsapi/jsapi.json

31
designer-base/src/test/java/com/fr/design/javascript/jsapi/JSAPITreeHelperTest.java

@ -0,0 +1,31 @@
package com.fr.design.javascript.jsapi;
import java.util.List;
import javax.swing.tree.DefaultMutableTreeNode;
import junit.framework.TestCase;
public class JSAPITreeHelperTest extends TestCase {
public void testGetName(){
List<String> names = JSAPITreeHelper.getNames("Fine-Design_JSAPI_Public_Module_Toolbar");
assertEquals(names.size(),4);
assertTrue(names.contains( "toolBarFloat"));
assertTrue(names.contains( "setStyle"));
assertTrue(names.contains( "getToolbar"));
assertTrue(names.contains( "changeFormat"));
List<String> allNames = JSAPITreeHelper.getAllNames();
assertEquals(allNames.size(),16);
}
public void testGetDirectCategory(){
String directCategory = JSAPITreeHelper.getDirectCategory("_g()");
assertEquals(directCategory,"Fine-Design_JSAPI_Public_Module_Global_Universal");
directCategory = JSAPITreeHelper.getDirectCategory("showCardByIndex");
assertEquals(directCategory,"Fine-Design_JSAPI_Form_Component_Tab");
}
public void testCreateJSAPITree(){
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode();
JSAPITreeHelper.createJSAPITree(rootNode);
assertEquals(2,rootNode.getChildCount());
}
}

17
designer-base/src/test/resources/com/fr/design/javascript/jsapi/category.json

@ -0,0 +1,17 @@
{
"Fine-Design_JSAPI_Public_Module": {
"Fine-Design_JSAPI_Public_Module_Global": {
"Fine-Design_JSAPI_Public_Module_Global_Universal": {},
"Fine-Design_JSAPI_Public_Module_Global_Mobile": {}
},
"Fine-Design_JSAPI_Public_Module_Widget": {
"Fine-Design_JSAPI_Public_Module_Date_Widget_Peculiar": {}
},
"Fine-Design_JSAPI_Public_Module_Toolbar": {
"Fine-Design_JSAPI_Public_Module_Toolbar_Email_Button": {}
}
},
"Fine-Design_JSAPI_Form": {
"Fine-Design_JSAPI_Form_Component_Tab": {}
}
}

8
designer-base/src/test/resources/com/fr/design/javascript/jsapi/jsapi.json

@ -0,0 +1,8 @@
{
"Fine-Design_JSAPI_Public_Module_Global_Universal": ["_g()", "getParameterContainer", "parameterCommit", "loadContentPane", "getPreviewType"],
"Fine-Design_JSAPI_Public_Module_Global_Mobile": ["location", "Mobile.getDeviceInfo"],
"Fine-Design_JSAPI_Public_Module_Date_Widget_Peculiar":["setMaxAndMinDate"],
"Fine-Design_JSAPI_Public_Module_Toolbar":["toolBarFloat", "setStyle","getToolbar"],
"Fine-Design_JSAPI_Public_Module_Toolbar_Email_Button":["changeFormat"],
"Fine-Design_JSAPI_Form_Component_Tab":["showCardByIndex", "showCardByIndex", "getShowIndex", "setTitleVisible"]
}
Loading…
Cancel
Save