* Test for {@link Utils#getFilesForResources(IFile, Collection)}. <br>
* Resource from required/inherited module in different {@link IProject}.
*/
@DisposeProjectAfter
public void test_getFilesForResources_inherited() throws Exception {
TestProject libProject = new TestProject("libProject");
try {
// prepare module "the.Library"
{
GTestUtils.createModule(libProject, "the.Library");
setFileContentSrc(
libProject.getProject(),
"the/public/sub/folder/libResource.txt",
"some content");
}
// require "libProject" from "TestProject"
m_testProject.addRequiredProject(libProject);
// configure module "test.Module" to inherit from "the.Library"
IFile moduleFile = getFileSrc("test/Module.gwt.xml");
setFileContent(
moduleFile,
getSourceDQ(
"<!-- filler filler filler filler filler -->",
"<module>",
" <inherits name='the.Library'/>",
"</module>"));
waitForAutoBuild();
// check resources
List<IFile> files =
Utils.getFilesForResources(
moduleFile,
Lists.newArrayList("Module.html", "sub/folder/libResource.txt"));
assertThat(files).hasSize(2);
assertResourcePath("war/Module.html", files.get(0));
assertResourcePath("src/the/public/sub/folder/libResource.txt", files.get(1));
} finally {
libProject.dispose();
}
}