|
|
@ -19,8 +19,7 @@ package org.springframework.boot.devtools.classpath;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.springframework.boot.devtools.classpath.ClassPathRestartStrategy;
|
|
|
|
|
|
|
|
import org.springframework.boot.devtools.classpath.PatternClassPathRestartStrategy;
|
|
|
|
|
|
|
|
import org.springframework.boot.devtools.filewatch.ChangedFile;
|
|
|
|
import org.springframework.boot.devtools.filewatch.ChangedFile;
|
|
|
|
import org.springframework.boot.devtools.filewatch.ChangedFile.Type;
|
|
|
|
import org.springframework.boot.devtools.filewatch.ChangedFile.Type;
|
|
|
|
|
|
|
|
|
|
|
@ -31,6 +30,7 @@ import static org.junit.Assert.assertThat;
|
|
|
|
* Tests for {@link PatternClassPathRestartStrategy}.
|
|
|
|
* Tests for {@link PatternClassPathRestartStrategy}.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author Phillip Webb
|
|
|
|
* @author Phillip Webb
|
|
|
|
|
|
|
|
* @author Andrew Landsverk
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class PatternClassPathRestartStrategyTests {
|
|
|
|
public class PatternClassPathRestartStrategyTests {
|
|
|
|
|
|
|
|
|
|
|
@ -66,6 +66,16 @@ public class PatternClassPathRestartStrategyTests {
|
|
|
|
assertRestartRequired(strategy, "src/folder/file.txt", true);
|
|
|
|
assertRestartRequired(strategy, "src/folder/file.txt", true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void pomChange() throws Exception {
|
|
|
|
|
|
|
|
ClassPathRestartStrategy strategy = createStrategy("META-INF/maven/**");
|
|
|
|
|
|
|
|
assertRestartRequired(strategy, "pom.xml", true);
|
|
|
|
|
|
|
|
assertRestartRequired(strategy,
|
|
|
|
|
|
|
|
"META-INF/maven/org.springframework.boot/spring-boot-devtools/pom.xml", false);
|
|
|
|
|
|
|
|
assertRestartRequired(strategy,
|
|
|
|
|
|
|
|
"META-INF/maven/org.springframework.boot/spring-boot-devtools/pom.properties", false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ClassPathRestartStrategy createStrategy(String pattern) {
|
|
|
|
private ClassPathRestartStrategy createStrategy(String pattern) {
|
|
|
|
return new PatternClassPathRestartStrategy(pattern);
|
|
|
|
return new PatternClassPathRestartStrategy(pattern);
|
|
|
|
}
|
|
|
|
}
|
|
|
|