@Test public void testFetchRequestHttpbinCallback() throws Exception{ WXStreamModule streamModule = createModule(new DefaultWXHttpAdapter()); JSCallback progress = mock(JSCallback.class); JSCallback finish = mock(JSCallback.class); System.out.print("request start "+System.currentTimeMillis()); streamModule.fetch("{method: 'POST',url: 'http: verify(progress,timeout(10*1000).atLeastOnce()).invokeAndKeepAlive(anyMapOf(String.class, Object.class)); verify(finish,timeout(10*1000).times(1)).invoke(anyMapOf(String.class, Object.class)); System.out.print("\nrequest finish"+System.currentTimeMillis()); }
@JSMethod(uiThread = false) public void fetch(JSONObject optionsObj , final JSCallback callback, JSCallback progressCallback){ fetch(optionsObj, callback, progressCallback, mWXSDKInstance.getInstanceId(), mWXSDKInstance.getBundleUrl()); }
WXStreamModule extends WXModule { @JSMethod(uiThread = false) public void fetch(JSONObject optionsObj , final JSCallback callback, JSCallback progressCallback){ fetch(optionsObj, callback, progressCallback, mWXSDKInstance.getInstanceId(), mWXSDKInstance.getBundleUrl()); } }
WXStreamModule extends WXModule { @JSMethod(uiThread = false) public void fetch(JSONObject optionsObj , final JSCallback callback, JSCallback progressCallback){ fetch(optionsObj, callback, progressCallback, mWXSDKInstance.getInstanceId(), mWXSDKInstance.getBundleUrl()); } WXStreamModule();  WXStreamModule(IWXHttpAdapter adapter); }
WXStreamModule extends WXModule { @JSMethod(uiThread = false) public void fetch(JSONObject optionsObj , final JSCallback callback, JSCallback progressCallback){ fetch(optionsObj, callback, progressCallback, mWXSDKInstance.getInstanceId(), mWXSDKInstance.getBundleUrl()); } WXStreamModule();  WXStreamModule(IWXHttpAdapter adapter); @Deprecated @JSMethod(uiThread = false) void sendHttp(JSONObject paramsObj, final String callback); @JSMethod(uiThread = false) void fetch(JSONObject optionsObj , final JSCallback callback, JSCallback progressCallback); void fetch(JSONObject optionsObj , final JSCallback callback, JSCallback progressCallback, String instanceId, String bundleURL); }
WXStreamModule extends WXModule { @JSMethod(uiThread = false) public void fetch(JSONObject optionsObj , final JSCallback callback, JSCallback progressCallback){ fetch(optionsObj, callback, progressCallback, mWXSDKInstance.getInstanceId(), mWXSDKInstance.getBundleUrl()); } WXStreamModule();  WXStreamModule(IWXHttpAdapter adapter); @Deprecated @JSMethod(uiThread = false) void sendHttp(JSONObject paramsObj, final String callback); @JSMethod(uiThread = false) void fetch(JSONObject optionsObj , final JSCallback callback, JSCallback progressCallback); void fetch(JSONObject optionsObj , final JSCallback callback, JSCallback progressCallback, String instanceId, String bundleURL); static final String STATUS_TEXT; static final String STATUS; }