我有一个模块自动化功能,用于测试另一个模块“ Teridion”是否具有依赖关系
teridion.pom:
<dependencies>
<dependency>
<groupId>com.teridion</groupId>
<artifactId>automation-tests</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
我想使用Spring来对Teridion模块进行调用,该模块具有来自Automation-tests模块的TestConfig.class的ContextConfiguration:
@ContextConfiguration(classes = TestConfig.class)
@Listeners({ MethodListener.class, TestNGListener.class, TestRunExecution.class})
public class TeridionTest extends BaseSeleniumTest {
TestConfig具有指向资源“ / sut / $ {env}”的classPath:
@Configuration
@ComponentScan
@PropertySource(value = {"classpath:/sut/${env}",
"file:${prop.location}"}, ignoreResourceNotFound = true)
public class TestConfig {
private String tmsHostValue;
private String tmsInternalIpValue;
尝试以surefire运行时,我得到了文件系统中不存在的资源文件错误:
java.io.FileNotFoundException:类路径资源[sut / emptyEnv.properties]无法解析为绝对文件路径,因为它不驻留在文件系统中:jar:file:/ C:/Users/OrenB/.m2 /repository/com/teridion/automation-tests/1.0-SNAPSHOT/automation-tests-1.0-SNAPSHOT.jar!/sut/emptyEnv.properties
如何获取其他模块资源?