use of org.springframework.boot.devtools.livereload.LiveReloadServer in project spring-boot by spring-projects.
the class LocalDevToolsAutoConfigurationTests method liveReloadNotTriggeredOnClassPathChangeWithRestart.
@Test
public void liveReloadNotTriggeredOnClassPathChangeWithRestart() throws Exception {
this.context = initializeAndRun(ConfigWithMockLiveReload.class);
LiveReloadServer server = this.context.getBean(LiveReloadServer.class);
reset(server);
ClassPathChangedEvent event = new ClassPathChangedEvent(this.context, Collections.<ChangedFiles>emptySet(), true);
this.context.publishEvent(event);
verify(server, never()).triggerReload();
}
use of org.springframework.boot.devtools.livereload.LiveReloadServer in project spring-boot by spring-projects.
the class LocalDevToolsAutoConfigurationTests method liveReloadTriggeredOnContextRefresh.
@Test
public void liveReloadTriggeredOnContextRefresh() throws Exception {
this.context = initializeAndRun(ConfigWithMockLiveReload.class);
LiveReloadServer server = this.context.getBean(LiveReloadServer.class);
reset(server);
this.context.publishEvent(new ContextRefreshedEvent(this.context));
verify(server).triggerReload();
}
use of org.springframework.boot.devtools.livereload.LiveReloadServer in project spring-boot by spring-projects.
the class RemoteClientConfigurationTests method liveReloadOnClassPathChanged.
@Test
public void liveReloadOnClassPathChanged() throws Exception {
configure();
Set<ChangedFiles> changeSet = new HashSet<>();
ClassPathChangedEvent event = new ClassPathChangedEvent(this, changeSet, false);
this.context.publishEvent(event);
LiveReloadConfiguration configuration = this.context.getBean(LiveReloadConfiguration.class);
configuration.getExecutor().shutdown();
configuration.getExecutor().awaitTermination(2, TimeUnit.SECONDS);
LiveReloadServer server = this.context.getBean(LiveReloadServer.class);
verify(server).triggerReload();
}
use of org.springframework.boot.devtools.livereload.LiveReloadServer in project spring-boot by spring-projects.
the class LocalDevToolsAutoConfigurationTests method liveReloadServer.
@Test
public void liveReloadServer() throws Exception {
this.context = initializeAndRun(Config.class);
LiveReloadServer server = this.context.getBean(LiveReloadServer.class);
assertThat(server.isStarted()).isTrue();
}
use of org.springframework.boot.devtools.livereload.LiveReloadServer in project spring-boot by spring-projects.
the class LocalDevToolsAutoConfigurationTests method liveReloadTriggeredOnClassPathChangeWithoutRestart.
@Test
public void liveReloadTriggeredOnClassPathChangeWithoutRestart() throws Exception {
this.context = initializeAndRun(ConfigWithMockLiveReload.class);
LiveReloadServer server = this.context.getBean(LiveReloadServer.class);
reset(server);
ClassPathChangedEvent event = new ClassPathChangedEvent(this.context, Collections.<ChangedFiles>emptySet(), false);
this.context.publishEvent(event);
verify(server).triggerReload();
}
Aggregations