use of org.springframework.boot.devtools.classpath.ClassPathChangedEvent 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.classpath.ClassPathChangedEvent in project spring-boot by spring-projects.
the class ClassPathChangeUploaderTests method retriesOnConnectException.
@Test
public void retriesOnConnectException() throws Exception {
File sourceFolder = this.temp.newFolder();
ClassPathChangedEvent event = createClassPathChangedEvent(sourceFolder);
this.requestFactory.willRespond(new ConnectException());
this.requestFactory.willRespond(HttpStatus.OK);
this.uploader.onApplicationEvent(event);
assertThat(this.requestFactory.getExecutedRequests()).hasSize(2);
verifyUploadRequest(sourceFolder, this.requestFactory.getExecutedRequests().get(1));
}
use of org.springframework.boot.devtools.classpath.ClassPathChangedEvent 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