@Test public void doesNotFailOnMoreComplexPatterns() throws Exception { createFile("mismatching.properties"); createFile("Charms_Solar_SecondEdition_Matching.xml"); Set<ResourceFile> result = loader.getResourcesMatching("Charms_(.*?)_(.*?)(?:_.*)?\\.xml"); assertThat(result.size(), is(1)); }
@Test public void returnsFileMatchingPattern() throws Exception { createFile("matching.properties"); createFile("mismatching.xml"); Set<ResourceFile> result = loader.getResourcesMatching(".*\\.properties"); assertThat(result.size(), is(1)); }
@Test public void returnsNamedFile() throws Exception { createFile("MATCH"); Set<ResourceFile> result = loader.getResourcesMatching("MATCH"); assertThat(result.size(), is(1)); }
@Test public void returnsNothingIfThereIsNoMatchingFile() throws Exception { Set<ResourceFile> result = loader.getResourcesMatching("NOMATCH"); assertThat(result.isEmpty(), is(true)); }