【问题标题】:NetBeans - Run JavaFx tests with command-line argumentsNetBeans - 使用命令行参数运行 JavaFx 测试
【发布时间】:2018-03-15 10:51:31
【问题描述】:

在 NetBeans -> 项目属性 -> 操作 -> 运行项目 - 我可以使用命令行参数设置 runfx.args 属性,并且在运行时,应用程序可以看到它们。我没有找到对测试(测试文件、测试项目操作)执行相同操作的方法。有什么帮助吗?

【问题讨论】:

    标签: javafx netbeans junit


    【解决方案1】:

    使用 maven 和 surefire 插件解决。参数作为系统属性传递给测试。 Surefire 配置如下所示:

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <configuration>
                <systemProperties>
                  <property>
                    <name>argName</name>
                    <value>argValue</value>
                  </property>
                </systemProperties>
              </configuration>
            </plugin>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多