0
我不知道如何測試GWT的異步RPC調用。在谷歌網站上我發現的示例代碼,但它並不全面:如何測試GWT的RPC調用?
public void testTimer() {
Timer timer = new Timer() {
public void run() {
finishTest();
}
};
delayTestFinish(500);
timer.schedule(100);
}
我在哪裏必須把調用遠程RPC服務?爲什麼我們需要計劃計時器(而不是使用run()
方法)?
感謝您的建議。
謝謝你,但我總是不斷地檢索錯誤...測試總是擊碎onFailure處方法內。在控制檯中,我看到我總是得到404錯誤。沒有從服務器檢索到內容,而是服務器我的應用程序發送數據(從HTTP標頭可以看到)。但從正常使用的應用程序(從網絡瀏覽器),所有的工作都很出色。它可以檢索和發送數據。 – MyTitle
我寫過我的RPC代碼,不想在我的rpc代碼中添加測試代碼。我該怎麼辦? –
?你在哪裏可以看到RPC函數中的測試代碼。這僅用於RPC調用 – Stefan