@Test
public void testGetSources() throws IOException {

    ApplicationContext applicationContext = createMock(ApplicationContext.class);
    ApplicationResource resource1 = createMock(ApplicationResource.class);
    expect(resource1.getLocale()).andReturn(Locale.ROOT);
    ApplicationResource resource2 = createMock(ApplicationResource.class);
    expect(resource2.getLocale()).andReturn(Locale.ITALY);
    ApplicationResource resource3 = createMock(ApplicationResource.class);
    expect(resource3.getLocale()).andReturn(Locale.ROOT);
    Collection<ApplicationResource> resourceSet1 = new HashSet<ApplicationResource>();
    resourceSet1.add(resource1);
    resourceSet1.add(resource2);
    Collection<ApplicationResource> resourceSet2 = new HashSet<ApplicationResource>();
    resourceSet2.add(resource3);
    expect(applicationContext.getResources("/WEB-INF/**/tiles*.xml")).andReturn(resourceSet1);
    expect(applicationContext.getResources("classpath*:META-INF/**/tiles*.xml")).andReturn(resourceSet2);
    replay(applicationContext, resource1, resource2, resource3);
    List<ApplicationResource> urls = factory.getSources(applicationContext);
    assertEquals(2, urls.size());
    assertTrue(urls.contains(resource1));
    assertTrue(urls.contains(resource3));
    verify(applicationContext, resource1, resource2, resource3);
}