test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/HttpServer.java in calabash-android-0.4.19.pre1 vs test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/HttpServer.java in calabash-android-0.4.19.pre2

- old
+ new

@@ -18,10 +18,11 @@ import sh.calaba.instrumentationbackend.FranklyResult; import sh.calaba.instrumentationbackend.InstrumentationBackend; import sh.calaba.instrumentationbackend.Result; import sh.calaba.instrumentationbackend.json.JSONUtils; import sh.calaba.instrumentationbackend.query.Query; +import sh.calaba.instrumentationbackend.query.QueryResult; import sh.calaba.org.codehaus.jackson.map.ObjectMapper; import android.graphics.Bitmap; import android.util.Log; import android.view.View; @@ -122,18 +123,19 @@ String commandString = params.getProperty("json"); ObjectMapper mapper = new ObjectMapper(); Map command = mapper.readValue(commandString, Map.class); String uiQuery = (String) command.get("query"); + uiQuery = uiQuery.trim(); Map op = (Map) command.get("operation"); @SuppressWarnings("unused") //TODO: support other methods, e.g., flash String methodName = (String) op.get("method_name"); List arguments = (List) op.get("arguments"); //For now we only support query - List queryResult = new Query(uiQuery,arguments).executeQuery(); + QueryResult queryResult = new Query(uiQuery,arguments).executeQuery(); return new NanoHTTPD.Response(HTTP_OK, "application/json;charset=utf-8", FranklyResult.successResult(queryResult).asJson()); } catch (Exception e ) { e.printStackTrace();