• 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

44.62
/src/main/java/com/uber/cadence/internal/replay/ExecuteActivityParameters.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.internal.replay;
19

20
import com.uber.cadence.ActivityType;
21
import com.uber.cadence.internal.common.RetryParameters;
22
import java.util.Arrays;
23
import java.util.Map;
24

25
public class ExecuteActivityParameters implements Cloneable {
26

27
  private String activityId;
28
  private ActivityType activityType;
29
  //    private String control;
30
  private long heartbeatTimeoutSeconds;
31
  private byte[] input;
32
  private long scheduleToCloseTimeoutSeconds;
33
  private long scheduleToStartTimeoutSeconds;
34
  private long startToCloseTimeoutSeconds;
35
  private String taskList;
36
  private RetryParameters retryParameters;
37
  private Map<String, byte[]> context;
38
  //    private int taskPriority;
39

40
  public ExecuteActivityParameters() {}
1✔
41

42
  //    /**
43
  //     * Returns the value of the Control property for this object.
44
  //     * <p>
45
  //     * <b>Constraints:</b><br/>
46
  //     * <b>Length: </b>0 - 100000<br/>
47
  //     *
48
  //     * @return The value of the Control property for this object.
49
  //     */
50
  //    public String getControl() {
51
  //        return control;
52
  //    }
53
  //
54
  //    /**
55
  //     * Sets the value of the Control property for this object.
56
  //     * <p>
57
  //     * <b>Constraints:</b><br/>
58
  //     * <b>Length: </b>0 - 100000<br/>
59
  //     *
60
  //     * @param control The new value for the Control property for this object.
61
  //     */
62
  //    public void setControl(String control) {
63
  //        this.control = control;
64
  //    }
65
  //
66
  //    /**
67
  //     * Sets the value of the Control property for this object.
68
  //     * <p>
69
  //     * Returns a reference to this object so that method calls can be chained together.
70
  //     * <p>
71
  //     * <b>Constraints:</b><br/>
72
  //     * <b>Length: </b>0 - 100000<br/>
73
  //     *
74
  //     * @param control The new value for the Control property for this object.
75
  //     *
76
  //     * @return A reference to this updated object so that method calls can be chained
77
  //     *         together.
78
  //     */
79
  //    public ExecuteActivityParameters withControl(String control) {
80
  //        this.control = control;
81
  //        return this;
82
  //    }
83

84
  /**
85
   * Returns the value of the ActivityType property for this object.
86
   *
87
   * @return The value of the ActivityType property for this object.
88
   */
89
  public ActivityType getActivityType() {
90
    return activityType;
1✔
91
  }
92

93
  /**
94
   * Sets the value of the ActivityType property for this object.
95
   *
96
   * @param activityType The new value for the ActivityType property for this object.
97
   */
98
  public void setActivityType(ActivityType activityType) {
UNCOV
99
    this.activityType = activityType;
×
UNCOV
100
  }
×
101

102
  /**
103
   * Sets the value of the ActivityType property for this object.
104
   *
105
   * <p>Returns a reference to this object so that method calls can be chained together.
106
   *
107
   * @param activityType The new value for the ActivityType property for this object.
108
   * @return A reference to this updated object so that method calls can be chained together.
109
   */
110
  public ExecuteActivityParameters withActivityType(ActivityType activityType) {
111
    this.activityType = activityType;
1✔
112
    return this;
1✔
113
  }
114

115
  /**
116
   * Returns the value of the ActivityId property for this object.
117
   *
118
   * <p><b>Constraints:</b><br>
119
   * <b>Length: </b>1 - 64<br>
120
   *
121
   * @return The value of the ActivityId property for this object.
122
   */
123
  public String getActivityId() {
124
    return activityId;
1✔
125
  }
126

127
  /**
128
   * Sets the value of the ActivityId property for this object.
129
   *
130
   * <p><b>Constraints:</b><br>
131
   * <b>Length: </b>1 - 64<br>
132
   *
133
   * @param activityId The new value for the ActivityId property for this object.
134
   */
135
  public void setActivityId(String activityId) {
UNCOV
136
    this.activityId = activityId;
×
UNCOV
137
  }
×
138

139
  /**
140
   * Sets the value of the ActivityId property for this object.
141
   *
142
   * <p>Returns a reference to this object so that method calls can be chained together.
143
   *
144
   * <p><b>Constraints:</b><br>
145
   * <b>Length: </b>1 - 64<br>
146
   *
147
   * @param activityId The new value for the ActivityId property for this object.
148
   * @return A reference to this updated object so that method calls can be chained together.
149
   */
150
  public ExecuteActivityParameters withActivityId(String activityId) {
UNCOV
151
    this.activityId = activityId;
×
UNCOV
152
    return this;
×
153
  }
154

155
  /**
156
   * Returns the value of the Input property for this object.
157
   *
158
   * <p><b>Constraints:</b><br>
159
   * <b>Length: </b>0 - 100000<br>
160
   *
161
   * @return The value of the Input property for this object.
162
   */
163
  public byte[] getInput() {
164
    return input;
1✔
165
  }
166

167
  /**
168
   * Sets the value of the Input property for this object.
169
   *
170
   * <p><b>Constraints:</b><br>
171
   * <b>Length: </b>0 - 100000<br>
172
   *
173
   * @param input The new value for the Input property for this object.
174
   */
175
  public void setInput(byte[] input) {
UNCOV
176
    this.input = input;
×
UNCOV
177
  }
×
178

179
  /**
180
   * Sets the value of the Input property for this object.
181
   *
182
   * <p>Returns a reference to this object so that method calls can be chained together.
183
   *
184
   * <p><b>Constraints:</b><br>
185
   * <b>Length: </b>0 - 100000<br>
186
   *
187
   * @param input The new value for the Input property for this object.
188
   * @return A reference to this updated object so that method calls can be chained together.
189
   */
190
  public ExecuteActivityParameters withInput(byte[] input) {
191
    this.input = input;
1✔
192
    return this;
1✔
193
  }
194

195
  public long getHeartbeatTimeoutSeconds() {
196
    return heartbeatTimeoutSeconds;
1✔
197
  }
198

199
  public void setHeartbeatTimeoutSeconds(long heartbeatTimeoutSeconds) {
200
    this.heartbeatTimeoutSeconds = heartbeatTimeoutSeconds;
1✔
201
  }
1✔
202

203
  public ExecuteActivityParameters withHeartbeatTimeoutSeconds(long heartbeatTimeoutSeconds) {
UNCOV
204
    this.heartbeatTimeoutSeconds = heartbeatTimeoutSeconds;
×
UNCOV
205
    return this;
×
206
  }
207

208
  /**
209
   * Returns the value of the ScheduleToStartTimeout property for this object.
210
   *
211
   * <p><b>Constraints:</b><br>
212
   * <b>Length: </b>1 - 64<br>
213
   *
214
   * @return The value of the ScheduleToStartTimeout property for this object.
215
   */
216
  public long getScheduleToStartTimeoutSeconds() {
217
    return scheduleToStartTimeoutSeconds;
1✔
218
  }
219

220
  /**
221
   * Sets the value of the ScheduleToStartTimeout property for this object.
222
   *
223
   * <p><b>Constraints:</b><br>
224
   * <b>Length: </b>1 - 64<br>
225
   *
226
   * @param scheduleToStartTimeoutSeconds The new value for the ScheduleToStartTimeout property for
227
   *     this object.
228
   */
229
  public void setScheduleToStartTimeoutSeconds(long scheduleToStartTimeoutSeconds) {
UNCOV
230
    this.scheduleToStartTimeoutSeconds = scheduleToStartTimeoutSeconds;
×
UNCOV
231
  }
×
232

233
  /**
234
   * Sets the value of the ScheduleToStartTimeout property for this object.
235
   *
236
   * <p>Returns a reference to this object so that method calls can be chained together.
237
   *
238
   * <p><b>Constraints:</b><br>
239
   * <b>Length: </b>1 - 64<br>
240
   *
241
   * @param scheduleToStartTimeoutSeconds The new value for the ScheduleToStartTimeout property for
242
   *     this object.
243
   * @return A reference to this updated object so that method calls can be chained together.
244
   */
245
  public ExecuteActivityParameters withScheduleToStartTimeoutSeconds(
246
      long scheduleToStartTimeoutSeconds) {
247
    this.scheduleToStartTimeoutSeconds = scheduleToStartTimeoutSeconds;
1✔
248
    return this;
1✔
249
  }
250

251
  /**
252
   * Returns the value of the ScheduleToCloseTimeout property for this object.
253
   *
254
   * <p><b>Constraints:</b><br>
255
   * <b>Length: </b>1 - 64<br>
256
   *
257
   * @return The value of the ScheduleToCloseTimeout property for this object.
258
   */
259
  public long getScheduleToCloseTimeoutSeconds() {
260
    return scheduleToCloseTimeoutSeconds;
1✔
261
  }
262

263
  /**
264
   * Sets the value of the ScheduleToCloseTimeout property for this object.
265
   *
266
   * <p><b>Constraints:</b><br>
267
   * <b>Length: </b>1 - 64<br>
268
   *
269
   * @param scheduleToCloseTimeoutSeconds The new value for the ScheduleToCloseTimeout property for
270
   *     this object.
271
   */
272
  public void setScheduleToCloseTimeoutSeconds(long scheduleToCloseTimeoutSeconds) {
UNCOV
273
    this.scheduleToCloseTimeoutSeconds = scheduleToCloseTimeoutSeconds;
×
UNCOV
274
  }
×
275

276
  /**
277
   * Sets the value of the ScheduleToCloseTimeout property for this object.
278
   *
279
   * <p>Returns a reference to this object so that method calls can be chained together.
280
   *
281
   * <p><b>Constraints:</b><br>
282
   * <b>Length: </b>1 - 64<br>
283
   *
284
   * @param scheduleToCloseTimeoutSeconds The new value for the ScheduleToCloseTimeout property for
285
   *     this object.
286
   * @return A reference to this updated object so that method calls can be chained together.
287
   */
288
  public ExecuteActivityParameters withScheduleToCloseTimeoutSeconds(
289
      long scheduleToCloseTimeoutSeconds) {
290
    this.scheduleToCloseTimeoutSeconds = scheduleToCloseTimeoutSeconds;
1✔
291
    return this;
1✔
292
  }
293

294
  public long getStartToCloseTimeoutSeconds() {
295
    return startToCloseTimeoutSeconds;
1✔
296
  }
297

298
  public void setStartToCloseTimeoutSeconds(long startToCloseTimeoutSeconds) {
UNCOV
299
    this.startToCloseTimeoutSeconds = startToCloseTimeoutSeconds;
×
UNCOV
300
  }
×
301

302
  public ExecuteActivityParameters withStartToCloseTimeoutSeconds(long startToCloseTimeoutSeconds) {
303
    this.startToCloseTimeoutSeconds = startToCloseTimeoutSeconds;
1✔
304
    return this;
1✔
305
  }
306

307
  /**
308
   * Returns the value of the TaskList property for this object.
309
   *
310
   * @return The value of the TaskList property for this object.
311
   */
312
  public String getTaskList() {
313
    return taskList;
1✔
314
  }
315

316
  /**
317
   * Sets the value of the TaskList property for this object.
318
   *
319
   * @param taskList The new value for the TaskList property for this object.
320
   */
321
  public void setTaskList(String taskList) {
UNCOV
322
    this.taskList = taskList;
×
UNCOV
323
  }
×
324

325
  /**
326
   * Sets the value of the TaskList property for this object.
327
   *
328
   * <p>Returns a reference to this object so that method calls can be chained together.
329
   *
330
   * @param taskList The new value for the TaskList property for this object.
331
   * @return A reference to this updated object so that method calls can be chained together.
332
   */
333
  public ExecuteActivityParameters withTaskList(String taskList) {
334
    this.taskList = taskList;
1✔
335
    return this;
1✔
336
  }
337

338
  public RetryParameters getRetryParameters() {
339
    return retryParameters;
1✔
340
  }
341

342
  public void setRetryParameters(RetryParameters retryParameters) {
343
    this.retryParameters = retryParameters;
1✔
344
  }
1✔
345

346
  public ExecuteActivityParameters withRetryParameters(RetryParameters retryParameters) {
UNCOV
347
    this.retryParameters = retryParameters;
×
UNCOV
348
    return this;
×
349
  }
350

351
  public Map<String, byte[]> getContext() {
352
    return context;
1✔
353
  }
354

355
  public void setContext(Map<String, byte[]> context) {
356
    this.context = context;
1✔
357
  }
1✔
358

359
  public ExecuteActivityParameters withContext(Map<String, byte[]> context) {
UNCOV
360
    this.context = context;
×
UNCOV
361
    return this;
×
362
  }
363

364
  @Override
365
  public String toString() {
UNCOV
366
    return "ExecuteActivityParameters{"
×
367
        + "activityId='"
368
        + activityId
369
        + '\''
370
        + ", activityType="
371
        + activityType
372
        + ", heartbeatTimeoutSeconds="
373
        + heartbeatTimeoutSeconds
374
        + ", input="
UNCOV
375
        + Arrays.toString(input)
×
376
        + ", scheduleToCloseTimeoutSeconds="
377
        + scheduleToCloseTimeoutSeconds
378
        + ", scheduleToStartTimeoutSeconds="
379
        + scheduleToStartTimeoutSeconds
380
        + ", startToCloseTimeoutSeconds="
381
        + startToCloseTimeoutSeconds
382
        + ", taskList='"
383
        + taskList
384
        + '\''
385
        + ", retryParameters="
386
        + retryParameters
387
        + ", context='"
388
        + context
389
        + '}';
390
  }
391

392
  public ExecuteActivityParameters copy() {
UNCOV
393
    ExecuteActivityParameters result = new ExecuteActivityParameters();
×
UNCOV
394
    result.setActivityType(activityType);
×
UNCOV
395
    result.setActivityId(activityId);
×
UNCOV
396
    result.setInput(input);
×
397
    //        result.setControl(control);
UNCOV
398
    result.setHeartbeatTimeoutSeconds(heartbeatTimeoutSeconds);
×
UNCOV
399
    result.setScheduleToStartTimeoutSeconds(scheduleToStartTimeoutSeconds);
×
UNCOV
400
    result.setScheduleToCloseTimeoutSeconds(scheduleToCloseTimeoutSeconds);
×
UNCOV
401
    result.setStartToCloseTimeoutSeconds(startToCloseTimeoutSeconds);
×
UNCOV
402
    result.setTaskList(taskList);
×
UNCOV
403
    result.setRetryParameters(retryParameters.copy());
×
UNCOV
404
    result.setContext(context);
×
405
    //        result.setTaskPriority(taskPriority);
UNCOV
406
    return result;
×
407
  }
408
}
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