Home
last modified time | relevance | path

Searched refs:json (Results 1 – 25 of 211) sorted by relevance

123456789

/tools/tradefederation/core/src/com/android/tradefed/cluster/
DClusterDeviceInfo.java20 import org.json.JSONException;
21 import org.json.JSONObject;
84 final JSONObject json = new JSONObject(); in toJSON() local
85 json.put("device_serial", mDeviceDescriptor.getSerial()); in toJSON()
86 json.put("run_target", mRunTarget); in toJSON()
87 json.put("build_id", mDeviceDescriptor.getBuildId()); in toJSON()
88 json.put("product", mDeviceDescriptor.getProduct()); in toJSON()
89 json.put("product_variant", mDeviceDescriptor.getProductVariant()); in toJSON()
90 json.put("sdk_version", mDeviceDescriptor.getSdkVersion()); in toJSON()
91 json.put("battery_level", mDeviceDescriptor.getBatteryLevel()); in toJSON()
[all …]
DTestGroupStatus.java18 import org.json.JSONException;
19 import org.json.JSONObject;
82 final JSONObject json = new JSONObject(); in toJSON() local
83 json.put("name", mName); in toJSON()
84 json.put("total_test_count", mTotalTestCount); in toJSON()
85 json.put("completed_test_count", mCompletedTestCount); in toJSON()
86 json.put("failed_test_count", mFailedTestCount); in toJSON()
87 json.put("passed_test_count", mPassedTestCount); in toJSON()
88 json.put("is_complete", mIsComplete); in toJSON()
89 json.put("elapsed_time", mElapsedTime); in toJSON()
[all …]
DClusterCommand.java24 import org.json.JSONArray;
25 import org.json.JSONException;
26 import org.json.JSONObject;
205 private static Integer optInteger(JSONObject json, String name) throws JSONException { in optInteger() argument
206 if (json.isNull(name)) { in optInteger()
209 return json.getInt(name); in optInteger()
212 public static ClusterCommand fromJson(JSONObject json) throws JSONException { in fromJson() argument
215 json.getString("request_id"), in fromJson()
216 json.getString("command_id"), in fromJson()
217 json.getString("task_id"), in fromJson()
[all …]
DTestContext.java24 import org.json.JSONArray;
25 import org.json.JSONException;
26 import org.json.JSONObject;
64 public static TestContext fromJson(JSONObject json) throws JSONException { in fromJson() argument
66 obj.mCommandLine = json.optString("command_line"); in fromJson()
67 final JSONArray envVars = json.optJSONArray("env_vars"); in fromJson()
74 final JSONArray testResources = json.optJSONArray("test_resources"); in fromJson()
82 final JSONObject json = new JSONObject(); in toJson() local
83 json.put("command_line", mCommandLine); in toJson()
91 json.put("env_vars", envVars); in toJson()
[all …]
DClusterHostEvent.java20 import org.json.JSONArray;
21 import org.json.JSONException;
22 import org.json.JSONObject;
207 final JSONObject json = new JSONObject(); in toJSON() local
209 json.put("time", this.getTimestamp() / 1000); in toJSON()
210 if (this.getType() != null) json.put("type", this.getType().toString()); in toJSON()
211 json.put("hostname", this.getHostName()); in toJSON()
212 json.put("tf_version", this.getTfVersion()); in toJSON()
213 json.put("cluster", this.getClusterId()); in toJSON()
218 json.put("device_infos", deviceInfos); in toJSON()
[all …]
DTestEnvironment.java25 import org.json.JSONArray;
26 import org.json.JSONException;
27 import org.json.JSONObject;
214 public static TestEnvironment fromJson(JSONObject json) throws JSONException { in fromJson() argument
216 final JSONArray envVars = json.optJSONArray("env_vars"); in fromJson()
225 JSONArray jvmOptions = json.optJSONArray("jvm_options"); in fromJson()
233 final JSONArray javaProperties = json.optJSONArray("java_properties"); in fromJson()
242 final JSONArray scripts = json.optJSONArray("setup_scripts"); in fromJson()
250 final JSONArray patterns = json.optJSONArray("output_file_patterns"); in fromJson()
258 final String url = json.optString("output_file_upload_url"); in fromJson()
[all …]
DClusterCommandEvent.java20 import org.json.JSONArray;
21 import org.json.JSONException;
22 import org.json.JSONObject;
208 final JSONObject json = new JSONObject(); in toJSON() local
209 json.put("type", this.getType().toString()); in toJSON()
211 json.put("time", this.getTimestamp() / 1000); in toJSON()
212 json.put("task_id", this.getCommandTaskId()); in toJSON()
213 json.put("attempt_id", this.getAttemptId()); in toJSON()
214 json.put("hostname", this.getHostName()); in toJSON()
217 json.put("device_serial", this.getDeviceSerials().iterator().next()); in toJSON()
[all …]
DInvocationStatus.java18 import org.json.JSONArray;
19 import org.json.JSONException;
20 import org.json.JSONObject;
44 final JSONObject json = new JSONObject(); in toJSON() local
49 json.put("test_group_statuses", testModuleStatuses); in toJSON()
50 return json; in toJSON()
DTradefedConfigObject.java23 import org.json.JSONArray;
24 import org.json.JSONException;
25 import org.json.JSONObject;
72 public static TradefedConfigObject fromJson(JSONObject json) throws JSONException { in fromJson() argument
74 JSONArray arr = json.optJSONArray("option_values"); in fromJson()
89 Type type = Type.valueOf(json.optString("type", Type.UNKNOWN.name())); in fromJson()
90 return new TradefedConfigObject(type, json.getString("class_name"), optionValues); in fromJson()
/tools/tradefederation/core/remote/src/com/android/tradefed/command/remote/
DGetLastCommandResultOp.java23 import org.json.JSONArray;
24 import org.json.JSONException;
25 import org.json.JSONObject;
56 static GetLastCommandResultOp createFromJson(JSONObject json) throws JSONException { in createFromJson() argument
57 return new GetLastCommandResultOp(json.getString(SERIAL)); in createFromJson()
72 protected void packIntoJson(JSONObject json) throws JSONException { in packIntoJson() argument
73 json.put(SERIAL, mSerial); in packIntoJson()
80 protected CommandResult unpackResponseFromJson(JSONObject json) throws JSONException { in unpackResponseFromJson() argument
83 String statusString = json.getString(STATUS); in unpackResponseFromJson()
90 String errorDetails = json.optString(INVOCATION_ERROR, null); in unpackResponseFromJson()
[all …]
DExecCommandOp.java18 import org.json.JSONArray;
19 import org.json.JSONException;
20 import org.json.JSONObject;
45 static ExecCommandOp createFromJson(JSONObject json) throws JSONException { in createFromJson() argument
46 String serial = json.getString(SERIAL); in createFromJson()
47 JSONArray jsonArgs = json.getJSONArray(COMMAND_ARGS); in createFromJson()
DStartHandoverOp.java18 import org.json.JSONException;
19 import org.json.JSONObject;
40 static StartHandoverOp createFromJson(JSONObject json) throws JSONException { in createFromJson() argument
41 return new StartHandoverOp(json.getInt(PORT)); in createFromJson()
DAllocateDeviceOp.java18 import org.json.JSONException;
19 import org.json.JSONObject;
42 static AllocateDeviceOp createFromJson(JSONObject json) throws JSONException { in createFromJson() argument
43 return new AllocateDeviceOp(json.getString(SERIAL)); in createFromJson()
DFreeDeviceOp.java18 import org.json.JSONException;
19 import org.json.JSONObject;
43 static FreeDeviceOp createFromJson(JSONObject json) throws JSONException { in createFromJson() argument
44 return new FreeDeviceOp(json.getString(SERIAL)); in createFromJson()
DCloseOp.java18 import org.json.JSONException;
19 import org.json.JSONObject;
37 static CloseOp createFromJson(JSONObject json) throws JSONException { in createFromJson() argument
DHandoverInitCompleteOp.java18 import org.json.JSONException;
19 import org.json.JSONObject;
35 static HandoverInitCompleteOp createFromJson(JSONObject json) throws JSONException { in createFromJson() argument
DHandoverCompleteOp.java18 import org.json.JSONException;
19 import org.json.JSONObject;
35 static HandoverCompleteOp createFromJson(JSONObject json) throws JSONException { in createFromJson() argument
/tools/tradefederation/core/global_configuration/com/android/tradefed/util/hostmetric/
DHostMetric.java18 import org.json.JSONException;
19 import org.json.JSONObject;
53 final JSONObject json = new JSONObject(); in toJson() local
54 json.put("name", mName); in toJson()
55 json.put("timestamp", mTimestamp); in toJson()
56 json.put("value", mValue); in toJson()
57 json.put("fields", new JSONObject(mData)); in toJson()
58 return json; in toJson()
/tools/test/connectivity/acts/framework/acts/test_utils/wifi/
Dwifi_datastore_utils.py17 import json
60 data=json.dumps({"hostname":name,
63 if response.json()['result'] == 'success':
80 data=json.dumps({"hostname":name}))
100 data=json.dumps({"hostname":name, "locked_by":admin}))
101 if response.json()['result']:
118 data=json.dumps({"hostname":name}))
119 if response.json()['result']:
137 return response.json()
150 return response.json()
/tools/tradefederation/core/tests/src/com/android/tradefed/cluster/
DClusterCommandTest.java21 import org.json.JSONArray;
22 import org.json.JSONObject;
23 import org.json.JSONException;
40 JSONObject json = createCommandJson().put("attempt_id", "attempt_id"); in testFromJson_withAssignedAttemptId() local
42 ClusterCommand command = ClusterCommand.fromJson(json); in testFromJson_withAssignedAttemptId()
53 JSONObject json = createCommandJson(); in testFromJson_withoutAssignedAttemptId() local
55 ClusterCommand command = ClusterCommand.fromJson(json); in testFromJson_withoutAssignedAttemptId()
70 JSONObject json = createCommandJson().put("extra_options", new JSONArray().put(option)); in testFromJson_extraOptions() local
72 ClusterCommand command = ClusterCommand.fromJson(json); in testFromJson_extraOptions()
/tools/loganalysis/tests/src/com/android/loganalysis/parser/
DCompactMemInfoParserTest.java22 import org.json.JSONArray;
23 import org.json.JSONException;
24 import org.json.JSONObject;
193 JSONObject json = item.toJson(); in testJson() local
194 assertNotNull(json); in testJson()
196 JSONArray processes = json.getJSONArray("processes"); in testJson()
199 assertEquals(1005, (long)json.get("lostRam")); in testJson()
200 assertEquals(1221694, (long) json.get("freeRam")); in testJson()
201 assertEquals(5800, (long) json.get("totalZram")); in testJson()
202 assertEquals(491632, (long) json.get("freeSwapZram")); in testJson()
[all …]
/tools/tradefederation/core/python-lib/tradefed_py/
Dtf_runner.py18 import json
51 self.stream.write('TEST_RUN_STARTED %s\n' % json.dumps(resp))
61 self.stream.write('TEST_STARTED %s\n' % json.dumps(resp))
71 self.stream.write('TEST_ENDED %s\n' % json.dumps(resp))
82 self.stream.write('TEST_FAILED %s\n' % json.dumps(resp))
84 self.stream.write('TEST_ENDED %s\n' % json.dumps(resp))
95 self.stream.write('TEST_IGNORED %s\n' % json.dumps(resp))
97 self.stream.write('TEST_ENDED %s\n' % json.dumps(resp))
108 self.stream.write('TEST_ASSUMPTION_FAILURE %s\n' % json.dumps(resp))
110 self.stream.write('TEST_ENDED %s\n' % json.dumps(resp))
[all …]
/tools/tradefederation/core/util-apps/WifiUtil/src/com/android/tradefed/utils/wifi/
DWifiConnector.java28 import org.json.JSONException;
29 import org.json.JSONObject;
341 final JSONObject json = new JSONObject(); in getWifiInfo() local
345 json.put("ssid", info.getSSID()); in getWifiInfo()
346 json.put("bssid", info.getBSSID()); in getWifiInfo()
347 json.put("hiddenSsid", info.getHiddenSSID()); in getWifiInfo()
354 json.put("ipAddress", String.format("%s.%s.%s.%s", a, b, c, d)); in getWifiInfo()
355 json.put("linkSpeed", info.getLinkSpeed()); in getWifiInfo()
356 json.put("rssi", info.getRssi()); in getWifiInfo()
357 json.put("macAddress", info.getMacAddress()); in getWifiInfo()
[all …]
/tools/test/connectivity/acts/framework/acts/controllers/fuchsia_lib/
Dbase_lib.py18 import json
54 test_data = json.dumps({
60 return requests.get(url=self.address, data=test_data).json()
/tools/tradefederation/core/src/com/android/tradefed/util/
DSubprocessExceptionParser.java25 import org.json.JSONException;
26 import org.json.JSONObject;
50 JSONObject json = new JSONObject(line); in handleStderrException() local
51 String filePath = json.getString(TradefedSandboxRunner.EXCEPTION_KEY); in handleStderrException()

123456789