IDEA-50429 Maven: properties usages are not resolved in filtered test resources

This commit is contained in:
Sergey Evdokimov
2012-12-25 18:15:04 +04:00
parent 58f342ef42
commit 5770bdefce
2 changed files with 23 additions and 1 deletions
@@ -327,7 +327,7 @@ public class MavenDomUtil {
if (cachedValue == null || cachedValue.first != VirtualFileManager.getInstance().getModificationCount()) {
Set<VirtualFile> set = null;
for (MavenResource resource : mavenProject.getResources()) {
for (MavenResource resource : ContainerUtil.concat(mavenProject.getResources(), mavenProject.getTestResources())) {
if (!resource.isFiltered()) continue;
VirtualFile resourceDir = LocalFileSystem.getInstance().findFileByPath(resource.getDirectory());
@@ -48,6 +48,28 @@ public class MavenFilteredPropertiesCompletionAndResolutionTest extends MavenDom
assertResolved(f, findTag("project.version"));
}
public void testTestResourceProperties() throws Exception {
createProjectSubDir("res");
importProject("<groupId>test</groupId>" +
"<artifactId>project</artifactId>" +
"<version>1</version>" +
"<build>" +
" <testResources>" +
" <testResource>" +
" <directory>res</directory>" +
" <filtering>true</filtering>" +
" </testResource>" +
" </testResources>" +
"</build>");
VirtualFile f = createProjectSubFile("res/foo.properties",
"foo=abc${project<caret>.version}abc");
assertResolved(f, findTag("project.version"));
}
public void testBasicAt() throws Exception {
createProjectSubDir("res");