-
Notifications
You must be signed in to change notification settings - Fork 15
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
Michel Davit
authored
Sep 19, 2024
1 parent
b12ab2b
commit 6ac31dc
Showing
3 changed files
with
54 additions
and
16 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
avro-tools/src/test/scala/org/apache/avro/tool/MainSpec.scala
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,16 @@ | ||
package org.apache.avro.tool | ||
|
||
import org.scalatest.flatspec.AnyFlatSpec | ||
import org.scalatest.matchers.should.Matchers | ||
|
||
class MainSpec extends AnyFlatSpec with Matchers { | ||
|
||
"avro-tools" should "display help" in { | ||
noException shouldBe thrownBy { | ||
// main calls System.exit. test with run | ||
val run = classOf[Main].getDeclaredMethod("run", classOf[Array[String]]) | ||
run.setAccessible(true) | ||
run.invoke(new Main(), Array("--help")) | ||
} | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
parquet-cli/src/test/scala/org/apache/parquet/cli/MainSpec.scala
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,19 @@ | ||
package org.apache.parquet.cli | ||
|
||
import org.apache.hadoop.conf.Configuration | ||
import org.apache.hadoop.util.ToolRunner | ||
import org.apache.log4j.PropertyConfigurator | ||
import org.scalatest.flatspec.AnyFlatSpec | ||
import org.scalatest.matchers.should.Matchers | ||
import org.slf4j.LoggerFactory | ||
|
||
class MainSpec extends AnyFlatSpec with Matchers { | ||
|
||
"parquet-cli" should "display help" in { | ||
noException shouldBe thrownBy { | ||
PropertyConfigurator.configure(classOf[Main].getResource("/cli-logging.properties")); | ||
val console = LoggerFactory.getLogger(classOf[Main]) | ||
ToolRunner.run(new Configuration, new Main(console), Array("--help")) | ||
} | ||
} | ||
} |