Package org.sonar.wsclient.issue

Examples of org.sonar.wsclient.issue.ActionPlan


    @Override
    public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean hasFocus) {
        JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, hasFocus);
        if (value instanceof ActionPlan) {
            ActionPlan actionPlan = (ActionPlan) value;
            DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM);
            label.setText(actionPlan.name() + " - " + dateFormat.format((actionPlan).deadLine()));
        }
        return label;
    }
View Full Code Here


    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
    List<ActionPlan> actionPlans = client.find("com.sonarsource.it.samples:simple-sample");

    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/search?project=com.sonarsource.it.samples:simple-sample");
    assertThat(actionPlans).hasSize(1);
    ActionPlan actionPlan = actionPlans.get(0);
    assertThat(actionPlan.key()).isEqualTo("382f6f2e-ad9d-424a-b973-9b065e04348a");
    assertThat(actionPlan.name()).isEqualTo("Long term");
    assertThat(actionPlan.description()).isEqualTo("Long term acton plan");
    assertThat(actionPlan.project()).isEqualTo("com.sonarsource.it.samples:simple-sample");
    assertThat(actionPlan.status()).isEqualTo("CLOSED");
    assertThat(actionPlan.userLogin()).isEqualTo("admin");
    assertThat(actionPlan.deadLine()).isNotNull();
    assertThat(actionPlan.totalIssues()).isEqualTo(3);
    assertThat(actionPlan.unresolvedIssues()).isEqualTo(2);
    assertThat(actionPlan.createdAt()).isNotNull();
    assertThat(actionPlan.updatedAt()).isNotNull();
  }
View Full Code Here

  public void should_create_action_plan() throws Exception {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");

    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
    ActionPlan result = client.create(
      NewActionPlan.create().name("Short term").project("org.sonar.Sample").description("Short term issues").deadLine(stringToDate("2014-01-01")));

    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/create");
    assertThat(httpServer.requestParams()).includes(
      entry("project", "org.sonar.Sample"),
View Full Code Here

  public void should_update_action_plan() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");

    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
    ActionPlan result = client.update(
      UpdateActionPlan.create().key("382f6f2e-ad9d-424a-b973-9b065e04348a").name("Short term").description("Short term issues").deadLine(stringToDate("2014-01-01")));

    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/update");
    assertThat(httpServer.requestParams()).includes(
      entry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a"),
View Full Code Here

  public void should_open_action_plan() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");

    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
    ActionPlan result = client.open("382f6f2e-ad9d-424a-b973-9b065e04348a");

    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/open");
    assertThat(httpServer.requestParams()).includes(
      entry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a")
    );
View Full Code Here

  public void should_close_action_plan() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");

    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
    ActionPlan result = client.close("382f6f2e-ad9d-424a-b973-9b065e04348a");

    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/close");
    assertThat(httpServer.requestParams()).includes(
      entry("key", "382f6f2e-ad9d-424a-b973-9b065e04348a")
    );
View Full Code Here

TOP

Related Classes of org.sonar.wsclient.issue.ActionPlan

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.