diff --git a/agent/agent_common/src/main/java/com/intuit/tank/http/BaseResponse.java b/agent/agent_common/src/main/java/com/intuit/tank/http/BaseResponse.java index 786e930ae..ea11fb8af 100644 --- a/agent/agent_common/src/main/java/com/intuit/tank/http/BaseResponse.java +++ b/agent/agent_common/src/main/java/com/intuit/tank/http/BaseResponse.java @@ -74,11 +74,22 @@ public String getLogMsg() { } this.responseLogMsg = sb.toString(); } catch (Exception ex) { - LOG.error("Error processing response: " + ex.getMessage(), ex); + LOG.error("Error processing response: {}", ex.getMessage(), ex); } return responseLogMsg; } + public String convertToCSV() { + StringBuilder sb = new StringBuilder(); + sb.append(this.httpCode).append(","); + sb.append(this.rspMessage).append(","); + sb.append(responseTime).append(","); + sb.append(getResponseSize()).append(","); + headers.forEach((key, value) -> sb.append(key).append(" = ").append(value.replace(",", "")).append(",")); + cookies.forEach((key, value) -> sb.append(key).append(" = ").append(value).append(",")); + return sb.toString(); + } + /** * Common codes are 200 OK, 202 accepted, 204 no content, 400 bad request, * 404 not found, 500 internal server error, 503 Service Unavailable diff --git a/tools/agent_debugger/src/main/java/com/intuit/tank/tools/debugger/ActionComponents.java b/tools/agent_debugger/src/main/java/com/intuit/tank/tools/debugger/ActionComponents.java index 2f8a9f2e8..23ec6013b 100644 --- a/tools/agent_debugger/src/main/java/com/intuit/tank/tools/debugger/ActionComponents.java +++ b/tools/agent_debugger/src/main/java/com/intuit/tank/tools/debugger/ActionComponents.java @@ -185,6 +185,8 @@ private void createToolBar(JComboBox testPlanChooser, JComboBox step.getResponse() != null) + .map(step -> step.getRequest().getRequestUrl() + "," + step.getResponse().convertToCSV()) + .forEach(pw::println); + } catch ( FileNotFoundException e) { + LOG.error("Error exporting CSV: {}", String.valueOf(e)); + } + } + } diff --git a/tools/agent_debugger/src/main/java/com/intuit/tank/tools/debugger/PanelBuilder.java b/tools/agent_debugger/src/main/java/com/intuit/tank/tools/debugger/PanelBuilder.java index a62692e25..17ead38f8 100644 --- a/tools/agent_debugger/src/main/java/com/intuit/tank/tools/debugger/PanelBuilder.java +++ b/tools/agent_debugger/src/main/java/com/intuit/tank/tools/debugger/PanelBuilder.java @@ -184,7 +184,7 @@ static Component createContentPanel(final AgentDebuggerFrame frame) { public void mousePressed(MouseEvent e) { scriptEditorTA.grabFocus(); try { - int offs = scriptEditorTA.viewToModel(e.getPoint()); + int offs = scriptEditorTA.viewToModel2D(e.getPoint()); if (offs > -1) { int line = scriptEditorTA.getLineOfOffset(offs); if (frame.getSteps().size() > line) { diff --git a/tools/agent_debugger/src/main/resources/gfx/16/database_table.png b/tools/agent_debugger/src/main/resources/gfx/16/database_table.png new file mode 100644 index 000000000..03c52ee23 Binary files /dev/null and b/tools/agent_debugger/src/main/resources/gfx/16/database_table.png differ