Exemple #1
0
  public static void main(String[] args) throws IOException, JSONException, InterruptedException {
    String clientId = WebPushTestUtils.handshake();
    String viewDefJson =
        "{"
            + "\"viewDefinitionName\": \"Single Swap Test View\", "
            +
            // "\"snapshotId\": \"Tst~123\", " + // use live data
            "\"portfolioViewport\": {"
            + "\"rowIds\": [0, 1, 2, 3], "
            + "\"lastTimestamps\": [null, null, null, null], "
            + "\"dependencyGraphCells\": [[0, 0], [1, 2]]"
            + "},"
            + "\"primitivesViewport\": {"
            + "\"rowIds\": [0, 1, 2, 3], "
            + "\"lastTimestamps\": [null, null, null, null], "
            + "\"dependencyGraphCells\": [[0, 0]]"
            + "}"
            + "}";
    String viewportUrl = WebPushTestUtils.createViewport(clientId, viewDefJson);
    //noinspection InfiniteLoopStatement
    while (true) {
      String csv = WebPushTestUtils.readFromPath(viewportUrl + "/report/csv");
      System.out.println(csv);

      Thread.sleep(2000);
    }
  }