gpt4 book ai didi

java - 从 Eclipse 中运行的 JUnit 测试检测 Eclipse 版本

转载 作者:行者123 更新时间:2023-11-30 07:00:13 27 4
gpt4 key购买 nike

我正在 Eclipse 中运行一系列使用 JavaJUnit 开发的系统测试,使用 Eclipse 控制台作为输出。我计划使用一些控制台字符为某些测试实现更好的控制台输出,这些字符在 Eclipse Mars ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=76936 ) 之前不受支持。

为了确保与运行旧版本 Eclipse 的同事的兼容性,我需要以编程方式检测 JUnit 测试中的 Eclipse 版本。这可能吗?如果可能,怎么做?

最佳答案

System.getProperty("eclipse.buildId");

将为您提供 Eclipse 构建 ID,类似于

4.4.2.M20150204-1700

关于java - 从 Eclipse 中运行的 JUnit 测试检测 Eclipse 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30799952/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com