forked from linkedin/venice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c266d99
commit f457fd5
Showing
3 changed files
with
42 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...rnal/venice-common/src/test/java/com/linkedin/venice/status/TestPushJobDetailsStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.linkedin.venice.status; | ||
|
||
import static com.linkedin.venice.status.PushJobDetailsStatus.COMPLETED; | ||
import static com.linkedin.venice.status.PushJobDetailsStatus.ERROR; | ||
import static com.linkedin.venice.status.PushJobDetailsStatus.KILLED; | ||
import static com.linkedin.venice.status.PushJobDetailsStatus.isFailed; | ||
import static com.linkedin.venice.status.PushJobDetailsStatus.isSucceeded; | ||
import static org.testng.Assert.assertFalse; | ||
import static org.testng.Assert.assertTrue; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
|
||
public class TestPushJobDetailsStatus { | ||
@Test | ||
public void testIsFailedOrIsSuccess() { | ||
for (PushJobDetailsStatus status: PushJobDetailsStatus.values()) { | ||
if (status == COMPLETED) { | ||
assertTrue(isSucceeded(status)); | ||
assertFalse(isFailed(status)); | ||
} else if (status == ERROR || status == KILLED) { | ||
assertTrue(isFailed(status)); | ||
assertFalse(isSucceeded(status)); | ||
} else { | ||
assertFalse(isSucceeded(status)); | ||
assertFalse(isFailed(status)); | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void testIsTerminal() { | ||
for (PushJobDetailsStatus status: PushJobDetailsStatus.values()) { | ||
if (status == COMPLETED || status == ERROR || status == KILLED) { | ||
assertTrue(PushJobDetailsStatus.isTerminal(status.getValue())); | ||
} else { | ||
assertFalse(PushJobDetailsStatus.isTerminal(status.getValue())); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters