【问题标题】:Scala Test JAR file with argument带有参数的 Scala 测试 JAR 文件
【发布时间】:2016-12-16 12:13:47
【问题描述】:

我正在使用 spark 2.0、sbt 0.13 和 Scala Test 3.0,我想知道我是否可以像执行主 JAR 文件一样从命令中传递参数来测试 JAR 文件。

例如,spark-submit my-test-file.jar args1 args2,我的测试套件中的测试用例可以获得 args1 和 args2 的值。

【问题讨论】:

    标签: scala apache-spark scalatest


    【解决方案1】:

    请将它们包装到一个属性文件中,可能是 testcase.properties 或 .conf 并使用如下...

    spark.driver.extraJavaOptions –Dlog4j.configuration=file:///spark/conf/log4j.properties -
    spark.executor.extraJavaOptions –Dlog4j.configuration=file:///spark/conf/log4j.properties -Dapplication.properties.file=hdfs:///some/path/on/hdfs/testcase.properties
    spark.application.properties.file hdfs:///some/path/on/hdfs/testcase.properties
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-10
      • 1970-01-01
      • 2020-09-01
      • 2017-01-17
      • 2018-11-03
      相关资源
      最近更新 更多