File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
main/java/org/springframework/batch/core
test/java/org/springframework/batch/core Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2006-2023 the original author or authors.
2
+ * Copyright 2006-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
29
29
*
30
30
* @author Dave Syer
31
31
* @author Mahmoud Ben Hassine
32
+ * @author JiWon Seo
32
33
*
33
34
*/
34
35
public class ExitStatus implements Serializable , Comparable <ExitStatus > {
@@ -231,7 +232,7 @@ public ExitStatus replaceExitCode(String code) {
231
232
* @return {@code true} if the exit code is {@code EXECUTING} or {@code UNKNOWN}.
232
233
*/
233
234
public boolean isRunning () {
234
- return " EXECUTING" . equals (this .exitCode ) || " UNKNOWN" .equals (this .exitCode );
235
+ return EXECUTING . exitCode . equals (this .exitCode ) || UNKNOWN . exitCode .equals (this .exitCode );
235
236
}
236
237
237
238
/**
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2006-2024 the original author or authors.
2
+ * Copyright 2006-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
33
33
/**
34
34
* @author Dave Syer
35
35
* @author Mahmoud Ben Hassine
36
+ * @author JiWon Seo
36
37
*
37
38
*/
38
39
class ExitStatusTests {
@@ -153,7 +154,7 @@ void testAddExitDescription() {
153
154
}
154
155
155
156
@ Test
156
- void testAddExitDescriptionWIthStacktrace () {
157
+ void testAddExitDescriptionWithStacktrace () {
157
158
ExitStatus status = ExitStatus .EXECUTING .addExitDescription (new RuntimeException ("Foo" ));
158
159
assertNotSame (ExitStatus .EXECUTING , status );
159
160
String description = status .getExitDescription ();
@@ -182,8 +183,15 @@ void testAddExitCodeWithDescription() {
182
183
}
183
184
184
185
@ Test
185
- void testUnknownIsRunning () {
186
+ void testIsRunning () {
187
+ // running statuses
188
+ assertTrue (ExitStatus .EXECUTING .isRunning ());
186
189
assertTrue (ExitStatus .UNKNOWN .isRunning ());
190
+ // non running statuses
191
+ assertFalse (ExitStatus .COMPLETED .isRunning ());
192
+ assertFalse (ExitStatus .FAILED .isRunning ());
193
+ assertFalse (ExitStatus .STOPPED .isRunning ());
194
+ assertFalse (ExitStatus .NOOP .isRunning ());
187
195
}
188
196
189
197
@ Test
You can’t perform that action at this time.
0 commit comments