[英]Detect Eclipse version from JUnit test running in Eclipse
I'm running a series of system tests developed with Java
and JUnit
within Eclipse
, using the Eclipse
console as output. 我正在运行一系列使用Eclipse
控制台作为输出在Eclipse
中使用Java
和JUnit
开发的系统测试。 I'm planning to implementing better console output for some tests using some console characters, which are not supported before Eclipse Mars ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=76936 ). 我计划使用某些控制台字符为某些测试实现更好的控制台输出,在Eclipse Mars之前不支持这些控制台字符( https://bugs.eclipse.org/bugs/show_bug.cgi?id=76936 )。
To ensure compatibility with colleagues running an older version of Eclipse
, I would need to detect the Eclipse
version in the JUnit test programatically . 为了确保与运行旧版Eclipse
同事兼容,我需要以编程方式在JUnit测试中检测Eclipse
版本 。 Is this possible and if yes, how? 这可能吗?如果可以,怎么办?
System.getProperty("eclipse.buildId");
将为您提供Eclipse构建ID,类似于
4.4.2.M20150204-1700
您可以通过Java属性获得它:
System.getProperty("eclipse.buildId").
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.