• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber / cadence-java-client / 2641

07 Nov 2024 08:14PM UTC coverage: 80.761% (+0.5%) from 80.243%
2641

Pull #954

buildkite

shijiesheng
add test
Pull Request #954: Fix unhandled exceptions in WorkflowServiceTChannel

6 of 6 new or added lines in 1 file covered. (100.0%)

93 existing lines in 7 files now uncovered.

15662 of 19393 relevant lines covered (80.76%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.82
/src/main/java/com/uber/cadence/client/ActivityCompletionException.java
1
/*
2
 *  Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
 *
4
 *  Modifications copyright (C) 2017 Uber Technologies, Inc.
5
 *
6
 *  Licensed under the Apache License, Version 2.0 (the "License"). You may not
7
 *  use this file except in compliance with the License. A copy of the License is
8
 *  located at
9
 *
10
 *  http://aws.amazon.com/apache2.0
11
 *
12
 *  or in the "license" file accompanying this file. This file is distributed on
13
 *  an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14
 *  express or implied. See the License for the specific language governing
15
 *  permissions and limitations under the License.
16
 */
17

18
package com.uber.cadence.client;
19

20
import com.uber.cadence.WorkflowExecution;
21
import com.uber.cadence.activity.ActivityTask;
22

23
/** Base exception for all failures returned by an activity completion client. */
24
public class ActivityCompletionException extends RuntimeException {
25

26
  private final WorkflowExecution execution;
27

28
  private final String activityType;
29

30
  private final String activityId;
31

32
  protected ActivityCompletionException(ActivityTask task) {
1✔
33
    execution = task.getWorkflowExecution();
1✔
34
    activityType = task.getActivityType();
1✔
35
    activityId = task.getActivityId();
1✔
36
  }
1✔
37

38
  protected ActivityCompletionException(ActivityTask task, Throwable cause) {
39
    super(
1✔
40
        task != null
1✔
41
            ? "Execution="
UNCOV
42
                + task.getWorkflowExecution()
×
43
                + ", ActivityType="
UNCOV
44
                + task.getActivityType()
×
45
                + ", ActivityID="
UNCOV
46
                + task.getActivityId()
×
47
            : null,
1✔
48
        cause);
49
    if (task != null) {
1✔
UNCOV
50
      execution = task.getWorkflowExecution();
×
UNCOV
51
      activityType = task.getActivityType();
×
UNCOV
52
      activityId = task.getActivityId();
×
53
    } else {
54
      execution = null;
1✔
55
      activityType = null;
1✔
56
      activityId = null;
1✔
57
    }
58
  }
1✔
59

60
  protected ActivityCompletionException(String activityId, Throwable cause) {
UNCOV
61
    super("ActivityId" + activityId, cause);
×
UNCOV
62
    this.execution = null;
×
UNCOV
63
    this.activityType = null;
×
UNCOV
64
    this.activityId = activityId;
×
UNCOV
65
  }
×
66

67
  protected ActivityCompletionException(Throwable cause) {
68
    this((ActivityTask) null, cause);
1✔
69
  }
1✔
70

71
  protected ActivityCompletionException() {
72
    super();
1✔
73
    execution = null;
1✔
74
    activityType = null;
1✔
75
    activityId = null;
1✔
76
  }
1✔
77

78
  public WorkflowExecution getExecution() {
UNCOV
79
    return execution;
×
80
  }
81

82
  public String getActivityType() {
UNCOV
83
    return activityType;
×
84
  }
85

86
  public String getActivityId() {
UNCOV
87
    return activityId;
×
88
  }
89
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc