[英]How to use a launch configuration as a template in eclipse
Is there a way to use a launch configuration in eclipse as a "template" such that I can just right click the java file containing the main class and run/debug it?有没有办法在 eclipse 中使用启动配置作为“模板”,这样我就可以右键单击包含主类的 java 文件并运行/调试它?
Launch configuration:启动配置:
I want to use this for running tests (we do not use any frameworks like JUnit) which are all in separate java files.我想用它来运行测试(我们不使用任何像 JUnit 这样的框架),它们都在单独的 java 文件中。 The launch configurations mainly have different environments (particularly the environment variables set) to control whether to run the test with logging/tracing on, etc. Right now, in order to run different tests using different environment variables, I have to keep changing the main class based on the test I want to run.启动配置主要有不同的环境(特别是设置的环境变量)来控制是否运行带有日志记录/跟踪等的测试。现在,为了使用不同的环境变量运行不同的测试,我必须不断改变主要基于我要运行的测试的类。
Yes it is possible.对的,这是可能的。 You can create a prototype as a template.您可以创建一个原型作为模板。 There are several steps necessary:有几个必要的步骤:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.