### Question:
WXDomModule extends WXModule { public void callDomMethod(JSONObject task, long... parseNanos) { if (task == null) { return; } String method = (String) task.get(WXBridgeManager.METHOD); JSONArray args = (JSONArray) task.get(WXBridgeManager.ARGS); callDomMethod(method,args,parseNanos); } WXDomModule(WXSDKInstance instance); void callDomMethod(JSONObject task, long... parseNanos); Object callDomMethod(String method, JSONArray args, long... parseNanos); void invokeMethod(String ref, String method, JSONArray args); void postAction(RenderAction action); void postAction(DOMAction action, boolean createContext); static final String CREATE_BODY; static final String UPDATE_ATTRS; static final String UPDATE_STYLE; static final String REMOVE_ELEMENT; static final String ADD_ELEMENT; static final String MOVE_ELEMENT; static final String ADD_EVENT; static final String REMOVE_EVENT; static final String CREATE_FINISH; static final String REFRESH_FINISH; static final String UPDATE_FINISH; static final String SCROLL_TO_ELEMENT; static final String ADD_RULE; static final String UPDATE_COMPONENT_DATA; static final String GET_COMPONENT_RECT; static final String WXDOM; static final String INVOKE_METHOD; static final String[] METHODS; }### Answer:
@Test public void testCallDomMethod() throws Exception { module.callDomMethod(null); JSONObject obj = new JSONObject(); for (String m : METHODS) { obj.put(WXBridgeManager.METHOD,m); module.callDomMethod(obj); } obj = new JSONObject(); for (Object[] args:ARGS_CASES ) { JSONArray ary = new JSONArray(); if(args == null){ ary = null; }else { for (Object arg : args ) { ary.add(arg); } } obj.put(WXBridgeManager.ARGS,ary); for (String m : METHODS) { obj.put(WXBridgeManager.METHOD,m); module.callDomMethod(obj); } } }