在Eclipse中,可以通过以下方法设置JUnit的默认启动配置工作目录:
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.jdt.launching.JUnitLaunchConfigurationType">
<stringAttribute key="application" value="com.example.MyTestClass" />
<stringAttribute key="runconfiguration" value="My Run Configuration" />
<stringAttribute key="testRunner" value="org.junit.runner.JUnitCore" />
<stringAttribute key="testSuiteFiles" value="**/TestCases.java" />
<stringAttribute key="workspaceroot" value=".metadata/.plugins/org.eclipse.debug.core/.launches" />
</launchConfiguration>
领取专属 10元无门槛券
手把手带您无忧上云