相关疑难解决方法(0)

错误java.lang.RuntimeException:Stub!在Android中进行Fitnesse测试

我正在尝试使用Fitnesse框架创建一个测试夹具,我想测试一个从服务器检索数据的函数(RESTFUL服务).我的测试用例非常简单:

public class FriendListActivityFixture extends ColumnFixture {
    public int URL;
    public String test() {
    JSONArray array = JsonHelper.getJsonArrayFromUrl("http://107.22.209.62/android/get_users.php");
    return array.toString();
    }
}

public static JSONArray getJsonArrayFromUrl(String url) {
        InputStream input = null;
        String result = "";
        JSONArray jsonArray = null;
        try {
            HttpClient httpclient = CustomHttpClient.getHttpClient();
            HttpPost httppost = new HttpPost(url);
            HttpResponse response = httpclient.execute(httppost);
            HttpEntity entity = response.getEntity();
            input = entity.getContent();
        }
        catch (Exception e) {
            Log.e(TAG + ".getJsonArrayFromUrl(String url)", "Error in http connection " + e.toString()); …
Run Code Online (Sandbox Code Playgroud)

testing rest android http fitnesse

26
推荐指数
3
解决办法
4万
查看次数

标签 统计

android ×1

fitnesse ×1

http ×1

rest ×1

testing ×1