本文整理了Java中org.eclipse.californium.core.Utils.prettyPrint()
方法的一些代码示例,展示了Utils.prettyPrint()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.prettyPrint()
方法的具体详情如下:
包路径:org.eclipse.californium.core.Utils
类名称:Utils
方法名:prettyPrint
[英]Formats a CoapResponse into a readable String representation.
[中]将CoapResponse格式化为可读的字符串表示形式。
代码示例来源:origin: eclipse/californium
/**
* Formats a {@link CoapResponse} into a readable String representation.
*
* @param r the CoapResponse
* @return the pretty print
*/
public static String prettyPrint(CoapResponse r) {
return prettyPrint(r.advanced());
}
代码示例来源:origin: org.eclipse.californium/californium-core
/**
* Formats a {@link CoapResponse} into a readable String representation.
*
* @param r the CoapResponse
* @return the pretty print
*/
public static String prettyPrint(CoapResponse r) {
return prettyPrint(r.advanced());
}
代码示例来源:origin: eclipse/californium
System.out.println(Utils.prettyPrint(response));
代码示例来源:origin: eclipse/californium
@Override
public void onResponse(Response response) {
System.out.println();
System.out.println("**** TEST: " + testName + " ****");
// checking the response
if (response != null) {
// print response info
if (verbose) {
System.out.println("Response received");
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
}
System.out.println("**** BEGIN CHECK ****");
if (checkResponse(request, response)) {
System.out.println("**** TEST PASSED ****");
addSummaryEntry(testName + ": PASSED");
} else {
System.out.println("**** TEST FAILED ****");
addSummaryEntry(testName + ": --FAILED--");
}
tickOffTest();
}
}
}
代码示例来源:origin: eclipse/californium
public void test() {
CoapResponse response = null;
try {
URI uri = new URI(SERVER_URI);
CoapClient client = new CoapClient(uri);
client.setEndpoint(new CoapEndpoint(dtlsConnector, NetworkConfig.getStandard()));
response = client.get();
} catch (URISyntaxException e) {
System.err.println("Invalid URI: " + e.getMessage());
System.exit(-1);
}
if (response != null) {
System.out.println(response.getCode());
System.out.println(response.getOptions());
System.out.println(response.getResponseText());
System.out.println("\nADVANCED\n");
System.out.println(Utils.prettyPrint(response));
} else {
System.out.println("No response received.");
}
}
代码示例来源:origin: eclipse/californium
System.out.println("Request for test " + this.testName
+ " sent");
Utils.prettyPrint(request);
代码示例来源:origin: eclipse/californium
System.out.println("Request for test " + this.testName
+ " sent");
Utils.prettyPrint(request);
代码示例来源:origin: eclipse/californium.tools
System.out.println(Utils.prettyPrint(response));
System.out.println("Time elapsed (ms): " + response.getRTT());
代码示例来源:origin: eclipse/californium
System.out.println("Request for test " + this.testName
+ " sent");
Utils.prettyPrint(request);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
代码示例来源:origin: eclipse/californium
Utils.prettyPrint(request);
System.out.println("Response received");
System.out.println("Time elapsed (ms): " + response.getRTT());
Utils.prettyPrint(response);
代码示例来源:origin: eclipse/californium
System.out.println("Request for test " + this.testName
+ " sent");
Utils.prettyPrint(request);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
代码示例来源:origin: eclipse/californium
System.out.println("Request for test " + this.testName
+ " sent");
Utils.prettyPrint(request);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
代码示例来源:origin: eclipse/californium
System.out.println("Request for test " + this.testName
+ " sent");
Utils.prettyPrint(request);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
代码示例来源:origin: eclipse/californium
System.out.println("Request for test " + this.testName
+ " sent");
Utils.prettyPrint(request);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
Utils.prettyPrint(response);
代码示例来源:origin: eclipse/californium
Utils.prettyPrint(request);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
代码示例来源:origin: eclipse/californium
System.out.println("Request for test " + this.testName
+ " sent");
Utils.prettyPrint(request);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
代码示例来源:origin: eclipse/californium
System.out.println("Request for test " + this.testName
+ " sent");
Utils.prettyPrint(request);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
代码示例来源:origin: eclipse/californium
Utils.prettyPrint(request);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
代码示例来源:origin: eclipse/californium
System.out.println("Request for test " + this.testName
+ " sent");
Utils.prettyPrint(request);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
代码示例来源:origin: eclipse/californium
System.out.println("Request for test " + this.testName
+ " sent");
Utils.prettyPrint(request);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
System.out.println("Response received");
System.out.println("Time elapsed (ms): " + response.getRTT());
Utils.prettyPrint(response);
内容来源于网络,如有侵权,请联系作者删除!