Java 类org.springframework.boot.devtools.classpath.ClassPathFileSystemWatcher 实例源码
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void watchingAdditionalPaths() throws Exception {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("spring.devtools.restart.additional-paths",
"src/main/java,src/test/java");
this.context = initializeAndRun(Config.class, properties);
ClassPathFileSystemWatcher classPathWatcher = this.context
.getBean(ClassPathFileSystemWatcher.class);
Object watcher = ReflectionTestUtils.getField(classPathWatcher,
"fileSystemWatcher");
@SuppressWarnings("unchecked")
Map<File, Object> folders = (Map<File, Object>) ReflectionTestUtils
.getField(watcher, "folders");
assertThat(folders).hasSize(2)
.containsKey(new File("src/main/java").getAbsoluteFile())
.containsKey(new File("src/test/java").getAbsoluteFile());
}
项目:spring-boot-concourse
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void watchingAdditionalPaths() throws Exception {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("spring.devtools.restart.additional-paths",
"src/main/java,src/test/java");
this.context = initializeAndRun(Config.class, properties);
ClassPathFileSystemWatcher classPathWatcher = this.context
.getBean(ClassPathFileSystemWatcher.class);
Object watcher = ReflectionTestUtils.getField(classPathWatcher,
"fileSystemWatcher");
@SuppressWarnings("unchecked")
Map<File, Object> folders = (Map<File, Object>) ReflectionTestUtils
.getField(watcher, "folders");
assertThat(folders).hasSize(2)
.containsKey(new File("src/main/java").getAbsoluteFile())
.containsKey(new File("src/test/java").getAbsoluteFile());
}
项目:contestparser
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void watchingAdditionalPaths() throws Exception {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("spring.devtools.restart.additional-paths",
"src/main/java,src/test/java");
this.context = initializeAndRun(Config.class, properties);
ClassPathFileSystemWatcher classPathWatcher = this.context
.getBean(ClassPathFileSystemWatcher.class);
Object watcher = ReflectionTestUtils.getField(classPathWatcher,
"fileSystemWatcher");
@SuppressWarnings("unchecked")
Map<File, Object> folders = (Map<File, Object>) ReflectionTestUtils
.getField(watcher, "folders");
assertThat(folders.size(), is(equalTo(2)));
assertThat(folders, hasKey(new File("src/main/java").getAbsoluteFile()));
assertThat(folders, hasKey(new File("src/test/java").getAbsoluteFile()));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:LocalDevToolsAutoConfiguration.java
@Bean
@ConditionalOnMissingBean
public ClassPathFileSystemWatcher classPathFileSystemWatcher() {
URL[] urls = Restarter.getInstance().getInitialUrls();
ClassPathFileSystemWatcher watcher = new ClassPathFileSystemWatcher(
fileSystemWatcherFactory(), classPathRestartStrategy(), urls);
watcher.setStopWatcherOnRestart(true);
return watcher;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:RemoteClientConfiguration.java
@Bean
public ClassPathFileSystemWatcher classPathFileSystemWatcher() {
DefaultRestartInitializer restartInitializer = new DefaultRestartInitializer();
URL[] urls = restartInitializer.getInitialUrls(Thread.currentThread());
if (urls == null) {
urls = new URL[0];
}
return new ClassPathFileSystemWatcher(getFileSystemWatcherFactory(),
classPathRestartStrategy(), urls);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void restartWatchingClassPath() throws Exception {
this.context = initializeAndRun(Config.class);
ClassPathFileSystemWatcher watcher = this.context
.getBean(ClassPathFileSystemWatcher.class);
assertThat(watcher).isNotNull();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void restartDisabled() throws Exception {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("spring.devtools.restart.enabled", false);
this.context = initializeAndRun(Config.class, properties);
this.thrown.expect(NoSuchBeanDefinitionException.class);
this.context.getBean(ClassPathFileSystemWatcher.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void restartWithTriggerFile() throws Exception {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("spring.devtools.restart.trigger-file", "somefile.txt");
this.context = initializeAndRun(Config.class, properties);
ClassPathFileSystemWatcher classPathWatcher = this.context
.getBean(ClassPathFileSystemWatcher.class);
Object watcher = ReflectionTestUtils.getField(classPathWatcher,
"fileSystemWatcher");
Object filter = ReflectionTestUtils.getField(watcher, "triggerFilter");
assertThat(filter).isInstanceOf(TriggerFileFilter.class);
}
项目:spring-boot-concourse
文件:LocalDevToolsAutoConfiguration.java
@Bean
@ConditionalOnMissingBean
public ClassPathFileSystemWatcher classPathFileSystemWatcher() {
URL[] urls = Restarter.getInstance().getInitialUrls();
ClassPathFileSystemWatcher watcher = new ClassPathFileSystemWatcher(
fileSystemWatcherFactory(), classPathRestartStrategy(), urls);
watcher.setStopWatcherOnRestart(true);
return watcher;
}
项目:spring-boot-concourse
文件:RemoteClientConfiguration.java
@Bean
public ClassPathFileSystemWatcher classPathFileSystemWatcher() {
DefaultRestartInitializer restartInitializer = new DefaultRestartInitializer();
URL[] urls = restartInitializer.getInitialUrls(Thread.currentThread());
if (urls == null) {
urls = new URL[0];
}
return new ClassPathFileSystemWatcher(getFileSystemWatcherFactory(),
classPathRestartStrategy(), urls);
}
项目:spring-boot-concourse
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void restartWatchingClassPath() throws Exception {
this.context = initializeAndRun(Config.class);
ClassPathFileSystemWatcher watcher = this.context
.getBean(ClassPathFileSystemWatcher.class);
assertThat(watcher).isNotNull();
}
项目:spring-boot-concourse
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void restartDisabled() throws Exception {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("spring.devtools.restart.enabled", false);
this.context = initializeAndRun(Config.class, properties);
this.thrown.expect(NoSuchBeanDefinitionException.class);
this.context.getBean(ClassPathFileSystemWatcher.class);
}
项目:spring-boot-concourse
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void restartWithTriggerFile() throws Exception {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("spring.devtools.restart.trigger-file", "somefile.txt");
this.context = initializeAndRun(Config.class, properties);
ClassPathFileSystemWatcher classPathWatcher = this.context
.getBean(ClassPathFileSystemWatcher.class);
Object watcher = ReflectionTestUtils.getField(classPathWatcher,
"fileSystemWatcher");
Object filter = ReflectionTestUtils.getField(watcher, "triggerFilter");
assertThat(filter).isInstanceOf(TriggerFileFilter.class);
}
项目:contestparser
文件:LocalDevToolsAutoConfiguration.java
@Bean
@ConditionalOnMissingBean
public ClassPathFileSystemWatcher classPathFileSystemWatcher() {
URL[] urls = Restarter.getInstance().getInitialUrls();
ClassPathFileSystemWatcher watcher = new ClassPathFileSystemWatcher(
fileSystemWatcherFactory(), classPathRestartStrategy(), urls);
watcher.setStopWatcherOnRestart(true);
return watcher;
}
项目:contestparser
文件:RemoteClientConfiguration.java
@Bean
public ClassPathFileSystemWatcher classPathFileSystemWatcher() {
DefaultRestartInitializer restartInitializer = new DefaultRestartInitializer();
URL[] urls = restartInitializer.getInitialUrls(Thread.currentThread());
if (urls == null) {
urls = new URL[0];
}
return new ClassPathFileSystemWatcher(getFileSystemWatcherFactory(),
classPathRestartStrategy(), urls);
}
项目:contestparser
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void restartWatchingClassPath() throws Exception {
this.context = initializeAndRun(Config.class);
ClassPathFileSystemWatcher watcher = this.context
.getBean(ClassPathFileSystemWatcher.class);
assertThat(watcher, notNullValue());
}
项目:contestparser
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void restartDisabled() throws Exception {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("spring.devtools.restart.enabled", false);
this.context = initializeAndRun(Config.class, properties);
this.thrown.expect(NoSuchBeanDefinitionException.class);
this.context.getBean(ClassPathFileSystemWatcher.class);
}
项目:contestparser
文件:LocalDevToolsAutoConfigurationTests.java
@Test
public void restartWithTriggerFile() throws Exception {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("spring.devtools.restart.trigger-file", "somefile.txt");
this.context = initializeAndRun(Config.class, properties);
ClassPathFileSystemWatcher classPathWatcher = this.context
.getBean(ClassPathFileSystemWatcher.class);
Object watcher = ReflectionTestUtils.getField(classPathWatcher,
"fileSystemWatcher");
Object filter = ReflectionTestUtils.getField(watcher, "triggerFilter");
assertThat(filter, instanceOf(TriggerFileFilter.class));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:RemoteClientConfigurationTests.java
@Test
public void remoteRestartDisabled() throws Exception {
configure("spring.devtools.remote.restart.enabled:false");
this.thrown.expect(NoSuchBeanDefinitionException.class);
this.context.getBean(ClassPathFileSystemWatcher.class);
}
项目:spring-boot-concourse
文件:RemoteClientConfigurationTests.java
@Test
public void remoteRestartDisabled() throws Exception {
configure("spring.devtools.remote.restart.enabled:false");
this.thrown.expect(NoSuchBeanDefinitionException.class);
this.context.getBean(ClassPathFileSystemWatcher.class);
}
项目:contestparser
文件:RemoteClientConfigurationTests.java
@Test
public void remoteRestartDisabled() throws Exception {
configure("spring.devtools.remote.restart.enabled:false");
this.thrown.expect(NoSuchBeanDefinitionException.class);
this.context.getBean(ClassPathFileSystemWatcher.class);
}