pengda
3 years ago
3 changed files with 56 additions and 0 deletions
@ -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()); |
||||||
|
} |
||||||
|
} |
@ -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": {} |
||||||
|
} |
||||||
|
} |
@ -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…
Reference in new issue