Allow remote restart to work with nested JARs

Update remote restart support so that JARs multi-module projects work.

Fixes gh-4040
This commit is contained in:
Phillip Webb
2015-10-14 01:31:10 -07:00
parent e79ef9b73b
commit 5150e051c0
3 changed files with 26 additions and 2 deletions

View File

@@ -70,6 +70,22 @@ public class DefaultSourceFolderUrlFilterTests {
doTest("my-module/something/quite/quite/mad/");
}
@Test
public void skippedProjects() throws Exception {
String sourceFolder = "/Users/me/code/spring-boot-samples/"
+ "spring-boot-sample-devtools";
URL jarUrl = new URL("jar:file:/Users/me/tmp/"
+ "spring-boot-sample-devtools-1.3.0.BUILD-SNAPSHOT.jar!/");
assertThat(this.filter.isMatch(sourceFolder, jarUrl), equalTo(true));
URL nestedJarUrl = new URL("jar:file:/Users/me/tmp/"
+ "spring-boot-sample-devtools-1.3.0.BUILD-SNAPSHOT.jar!/"
+ "lib/spring-boot-1.3.0.BUILD-SNAPSHOT.jar!/");
assertThat(this.filter.isMatch(sourceFolder, nestedJarUrl), equalTo(false));
URL fileUrl = new URL("file:/Users/me/tmp/"
+ "spring-boot-sample-devtools-1.3.0.BUILD-SNAPSHOT.jar");
assertThat(this.filter.isMatch(sourceFolder, fileUrl), equalTo(true));
}
private void doTest(String sourcePostfix) throws MalformedURLException {
doTest(sourcePostfix, "my-module", true);
doTest(sourcePostfix, "my-module-other", false);