This is an automated email from the ASF dual-hosted git repository.
yumwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 2f9c8ac25ba [SPARK-44242][CORE][FOLLOWUP] Use the `assertThrows`
method to fix Java linter issue
2f9c8ac25ba is described below
commit 2f9c8ac25ba634affe366ce55eb3f9e969e71ae3
Author: Yuming Wang <[email protected]>
AuthorDate: Sat Aug 12 17:37:32 2023 +0800
[SPARK-44242][CORE][FOLLOWUP] Use the `assertThrows` method to fix Java
linter issue
### What changes were proposed in this pull request?
Use the `assertThrows` method to test for exceptions.
### Why are the changes needed?
Fix Java linter issue.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
N/A.
Closes #42466 from wangyum/SPARK-44242.
Authored-by: Yuming Wang <[email protected]>
Signed-off-by: Yuming Wang <[email protected]>
---
.../org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java
b/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java
index 7a623bb76f3..e07095167da 100644
---
a/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java
+++
b/launcher/src/test/java/org/apache/spark/launcher/SparkSubmitCommandBuilderSuite.java
@@ -72,7 +72,7 @@ public class SparkSubmitCommandBuilderSuite extends BaseSuite
{
cmd.contains("org.apache.spark.deploy.SparkSubmit"));
}
- @Test(expected = IllegalArgumentException.class)
+ @Test
public void testCheckJavaOptionsThrowException() throws Exception {
Map<String, String> env = new HashMap<>();
List<String> sparkSubmitArgs = Arrays.asList(
@@ -84,7 +84,7 @@ public class SparkSubmitCommandBuilderSuite extends BaseSuite
{
"-Xmx64g -Dprop=Other -Dprop1=\"-Xmx -Xmx\" -Dprop2=\"-Xmx '-Xmx\" " +
"-Dprop3='-Xmx -Xmx' -Dprop4='-Xmx \"-Xmx'",
SparkLauncher.NO_RESOURCE);
- buildCommand(sparkSubmitArgs, env);
+ assertThrows(IllegalArgumentException.class, () ->
buildCommand(sparkSubmitArgs, env));
}
@Test
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]