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 11/*
2- * Copyright 2006-2023 the original author or authors.
2+ * Copyright 2006-2025 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2929 *
3030 * @author Dave Syer
3131 * @author Mahmoud Ben Hassine
32+ * @author JiWon Seo
3233 *
3334 */
3435public class ExitStatus implements Serializable , Comparable <ExitStatus > {
@@ -231,7 +232,7 @@ public ExitStatus replaceExitCode(String code) {
231232 * @return {@code true} if the exit code is {@code EXECUTING} or {@code UNKNOWN}.
232233 */
233234 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 );
235236 }
236237
237238 /**
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2006-2024 the original author or authors.
2+ * Copyright 2006-2025 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
3333/**
3434 * @author Dave Syer
3535 * @author Mahmoud Ben Hassine
36+ * @author JiWon Seo
3637 *
3738 */
3839class ExitStatusTests {
@@ -153,7 +154,7 @@ void testAddExitDescription() {
153154 }
154155
155156 @ Test
156- void testAddExitDescriptionWIthStacktrace () {
157+ void testAddExitDescriptionWithStacktrace () {
157158 ExitStatus status = ExitStatus .EXECUTING .addExitDescription (new RuntimeException ("Foo" ));
158159 assertNotSame (ExitStatus .EXECUTING , status );
159160 String description = status .getExitDescription ();
@@ -182,8 +183,15 @@ void testAddExitCodeWithDescription() {
182183 }
183184
184185 @ Test
185- void testUnknownIsRunning () {
186+ void testIsRunning () {
187+ // running statuses
188+ assertTrue (ExitStatus .EXECUTING .isRunning ());
186189 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 ());
187195 }
188196
189197 @ Test
You can’t perform that action at this time.
0 commit comments