commit
31d7ebc96e
|
@ -46,7 +46,7 @@ public class PropertyPlaceholderAutoConfigurationTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void propertyPlaceholderse() throws Exception {
|
public void propertyPlaceholders() throws Exception {
|
||||||
this.context.register(PropertyPlaceholderAutoConfiguration.class,
|
this.context.register(PropertyPlaceholderAutoConfiguration.class,
|
||||||
PlaceholderConfig.class);
|
PlaceholderConfig.class);
|
||||||
EnvironmentTestUtils.addEnvironment(this.context, "foo:two");
|
EnvironmentTestUtils.addEnvironment(this.context, "foo:two");
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class ServerPropertiesAutoConfigurationTests {
|
||||||
@Test
|
@Test
|
||||||
public void testAccidentalMultipleServerPropertiesBeans() throws Exception {
|
public void testAccidentalMultipleServerPropertiesBeans() throws Exception {
|
||||||
this.context = new AnnotationConfigEmbeddedWebApplicationContext();
|
this.context = new AnnotationConfigEmbeddedWebApplicationContext();
|
||||||
this.context.register(Config.class, MutiServerPropertiesBeanConfig.class,
|
this.context.register(Config.class, MultiServerPropertiesBeanConfig.class,
|
||||||
ServerPropertiesAutoConfiguration.class,
|
ServerPropertiesAutoConfiguration.class,
|
||||||
PropertyPlaceholderAutoConfiguration.class);
|
PropertyPlaceholderAutoConfiguration.class);
|
||||||
this.thrown.expect(ApplicationContextException.class);
|
this.thrown.expect(ApplicationContextException.class);
|
||||||
|
@ -222,7 +222,7 @@ public class ServerPropertiesAutoConfigurationTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
protected static class MutiServerPropertiesBeanConfig {
|
protected static class MultiServerPropertiesBeanConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public ServerProperties serverPropertiesOne() {
|
public ServerProperties serverPropertiesOne() {
|
||||||
|
|
|
@ -192,7 +192,7 @@ public class WebSocketMessagingAutoConfigurationTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public TomcatWebSocketContainerCustomizer tomcatCuztomiser() {
|
public TomcatWebSocketContainerCustomizer tomcatCustomizer() {
|
||||||
return new TomcatWebSocketContainerCustomizer();
|
return new TomcatWebSocketContainerCustomizer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class InitCommand extends OptionParsingCommand {
|
||||||
|
|
||||||
public InitCommand(InitOptionHandler handler) {
|
public InitCommand(InitOptionHandler handler) {
|
||||||
super("init",
|
super("init",
|
||||||
"Initialize a new project using Spring " + "Initialzr (start.spring.io)",
|
"Initialize a new project using Spring " + "Initializr (start.spring.io)",
|
||||||
handler);
|
handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ class ServiceCapabilitiesReportGenerator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance using the specified {@link InitializrService}.
|
* Creates an instance using the specified {@link InitializrService}.
|
||||||
* @param initializrService the initialzr service
|
* @param initializrService the initializr service
|
||||||
*/
|
*/
|
||||||
ServiceCapabilitiesReportGenerator(InitializrService initializrService) {
|
ServiceCapabilitiesReportGenerator(InitializrService initializrService) {
|
||||||
this.initializrService = initializrService;
|
this.initializrService = initializrService;
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.fusesource.jansi.Ansi;
|
||||||
import org.fusesource.jansi.AnsiRenderer.Code;
|
import org.fusesource.jansi.AnsiRenderer.Code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple utitliy class to build an ANSI string when supported by the {@link Terminal}.
|
* Simple utility class to build an ANSI string when supported by the {@link Terminal}.
|
||||||
*
|
*
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -59,10 +59,10 @@ public class CommandCompleter extends StringsCompleter {
|
||||||
for (OptionHelp optionHelp : command.getOptionsHelp()) {
|
for (OptionHelp optionHelp : command.getOptionsHelp()) {
|
||||||
options.addAll(optionHelp.getOptions());
|
options.addAll(optionHelp.getOptions());
|
||||||
}
|
}
|
||||||
AggregateCompleter arguementCompleters = new AggregateCompleter(
|
AggregateCompleter argumentCompleters = new AggregateCompleter(
|
||||||
new StringsCompleter(options), new FileNameCompleter());
|
new StringsCompleter(options), new FileNameCompleter());
|
||||||
ArgumentCompleter argumentCompleter = new ArgumentCompleter(argumentDelimiter,
|
ArgumentCompleter argumentCompleter = new ArgumentCompleter(argumentDelimiter,
|
||||||
arguementCompleters);
|
argumentCompleters);
|
||||||
argumentCompleter.setStrict(false);
|
argumentCompleter.setStrict(false);
|
||||||
this.commandCompleters.put(command.getName(), argumentCompleter);
|
this.commandCompleters.put(command.getName(), argumentCompleter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class Shell {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Final handle an interrup signal (CTRL-C).
|
* Final handle an interrupt signal (CTRL-C).
|
||||||
*/
|
*/
|
||||||
protected void handleSigInt() {
|
protected void handleSigInt() {
|
||||||
if (this.commandRunner.handleSigInt()) {
|
if (this.commandRunner.handleSigInt()) {
|
||||||
|
|
|
@ -92,9 +92,9 @@ public class DependencyCustomizer {
|
||||||
return new DependencyCustomizer(this) {
|
return new DependencyCustomizer(this) {
|
||||||
@Override
|
@Override
|
||||||
protected boolean canAdd() {
|
protected boolean canAdd() {
|
||||||
for (String classname : classNames) {
|
for (String className : classNames) {
|
||||||
try {
|
try {
|
||||||
DependencyCustomizer.this.loader.loadClass(classname);
|
DependencyCustomizer.this.loader.loadClass(className);
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -115,9 +115,9 @@ public class DependencyCustomizer {
|
||||||
return new DependencyCustomizer(this) {
|
return new DependencyCustomizer(this) {
|
||||||
@Override
|
@Override
|
||||||
protected boolean canAdd() {
|
protected boolean canAdd() {
|
||||||
for (String classname : classNames) {
|
for (String className : classNames) {
|
||||||
try {
|
try {
|
||||||
DependencyCustomizer.this.loader.loadClass(classname);
|
DependencyCustomizer.this.loader.loadClass(className);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
|
|
|
@ -56,10 +56,10 @@ public class SpringTestCompilerAutoConfiguration extends CompilerAutoConfigurati
|
||||||
GeneratorContext generatorContext, SourceUnit source, ClassNode classNode)
|
GeneratorContext generatorContext, SourceUnit source, ClassNode classNode)
|
||||||
throws CompilationFailedException {
|
throws CompilationFailedException {
|
||||||
if (!AstUtils.hasAtLeastOneAnnotation(classNode, "RunWith")) {
|
if (!AstUtils.hasAtLeastOneAnnotation(classNode, "RunWith")) {
|
||||||
AnnotationNode runwith = new AnnotationNode(ClassHelper.make("RunWith"));
|
AnnotationNode runWith = new AnnotationNode(ClassHelper.make("RunWith"));
|
||||||
runwith.addMember("value",
|
runWith.addMember("value",
|
||||||
new ClassExpression(ClassHelper.make("SpringJUnit4ClassRunner")));
|
new ClassExpression(ClassHelper.make("SpringJUnit4ClassRunner")));
|
||||||
classNode.addAnnotation(runwith);
|
classNode.addAnnotation(runWith);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ import groovy.text.TemplateEngine;
|
||||||
import org.codehaus.groovy.control.CompilationFailedException;
|
import org.codehaus.groovy.control.CompilationFailedException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helpful utilties for working with Groovy {@link Template}s.
|
* Helpful utilities for working with Groovy {@link Template}s.
|
||||||
*
|
*
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -130,8 +130,8 @@ public class RemoteDevToolsAutoConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean(name = "remoteRestartHanderMapper")
|
@ConditionalOnMissingBean(name = "remoteRestartHandlerMapper")
|
||||||
public UrlHandlerMapper remoteRestartHanderMapper(HttpRestartServer server) {
|
public UrlHandlerMapper remoteRestartHandlerMapper(HttpRestartServer server) {
|
||||||
String url = (this.serverProperties.getContextPath() == null ? ""
|
String url = (this.serverProperties.getContextPath() == null ? ""
|
||||||
: this.serverProperties.getContextPath())
|
: this.serverProperties.getContextPath())
|
||||||
+ this.properties.getRemote().getContextPath() + "/restart";
|
+ this.properties.getRemote().getContextPath() + "/restart";
|
||||||
|
@ -155,8 +155,8 @@ public class RemoteDevToolsAutoConfiguration {
|
||||||
private ServerProperties serverProperties;
|
private ServerProperties serverProperties;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean(name = "remoteDebugHanderMapper")
|
@ConditionalOnMissingBean(name = "remoteDebugHandlerMapper")
|
||||||
public UrlHandlerMapper remoteDebugHanderMapper(
|
public UrlHandlerMapper remoteDebugHandlerMapper(
|
||||||
@Qualifier("remoteDebugHttpTunnelServer") HttpTunnelServer server) {
|
@Qualifier("remoteDebugHttpTunnelServer") HttpTunnelServer server) {
|
||||||
String url = (this.serverProperties.getContextPath() == null ? ""
|
String url = (this.serverProperties.getContextPath() == null ? ""
|
||||||
: this.serverProperties.getContextPath())
|
: this.serverProperties.getContextPath())
|
||||||
|
|
|
@ -240,7 +240,7 @@ public class FileSystemWatcher {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop monitoring the source folders.
|
* Stop monitoring the source folders.
|
||||||
* @param remainingScans the number of scans remaming
|
* @param remainingScans the number of remaining scans
|
||||||
*/
|
*/
|
||||||
synchronized void stopAfter(int remainingScans) {
|
synchronized void stopAfter(int remainingScans) {
|
||||||
Thread thread = this.watchThread;
|
Thread thread = this.watchThread;
|
||||||
|
|
|
@ -113,7 +113,7 @@ class Connection {
|
||||||
throw new ConnectionClosedException();
|
throw new ConnectionClosedException();
|
||||||
}
|
}
|
||||||
else if (frame.getType() == Frame.Type.TEXT) {
|
else if (frame.getType() == Frame.Type.TEXT) {
|
||||||
logger.debug("Recieved LiveReload text frame " + frame);
|
logger.debug("Received LiveReload text frame " + frame);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new IOException("Unexpected Frame Type " + frame.getType());
|
throw new IOException("Unexpected Frame Type " + frame.getType());
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class UrlHandlerMapper implements HandlerMapper {
|
||||||
|
|
||||||
private final String requestUri;
|
private final String requestUri;
|
||||||
|
|
||||||
private final Handler hander;
|
private final Handler handler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new {@link UrlHandlerMapper}.
|
* Create a new {@link UrlHandlerMapper}.
|
||||||
|
@ -41,13 +41,13 @@ public class UrlHandlerMapper implements HandlerMapper {
|
||||||
Assert.hasLength(url, "URL must not be empty");
|
Assert.hasLength(url, "URL must not be empty");
|
||||||
Assert.isTrue(url.startsWith("/"), "URL must start with '/'");
|
Assert.isTrue(url.startsWith("/"), "URL must start with '/'");
|
||||||
this.requestUri = url;
|
this.requestUri = url;
|
||||||
this.hander = handler;
|
this.handler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Handler getHandler(ServerHttpRequest request) {
|
public Handler getHandler(ServerHttpRequest request) {
|
||||||
if (this.requestUri.equals(request.getURI().getPath())) {
|
if (this.requestUri.equals(request.getURI().getPath())) {
|
||||||
return this.hander;
|
return this.handler;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,11 +158,11 @@ public class HttpTunnelConnection implements TunnelConnection {
|
||||||
}
|
}
|
||||||
catch (IOException ex) {
|
catch (IOException ex) {
|
||||||
logger.trace("Unexpected connection error", ex);
|
logger.trace("Unexpected connection error", ex);
|
||||||
closeQuitely();
|
closeQuietly();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void closeQuitely() {
|
private void closeQuietly() {
|
||||||
try {
|
try {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class LocalDevToolsAutoConfigurationTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void defaultPropertyCanBeOverridenFromCommandLine() throws Exception {
|
public void defaultPropertyCanBeOverriddenFromCommandLine() throws Exception {
|
||||||
this.context = initializeAndRun(Config.class, "--spring.thymeleaf.cache=true");
|
this.context = initializeAndRun(Config.class, "--spring.thymeleaf.cache=true");
|
||||||
TemplateResolver resolver = this.context.getBean(TemplateResolver.class);
|
TemplateResolver resolver = this.context.getBean(TemplateResolver.class);
|
||||||
resolver.initialize();
|
resolver.initialize();
|
||||||
|
@ -100,7 +100,7 @@ public class LocalDevToolsAutoConfigurationTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void defaultPropertyCanBeOverridenFromUserHomeProperties() throws Exception {
|
public void defaultPropertyCanBeOverriddenFromUserHomeProperties() throws Exception {
|
||||||
String userHome = System.getProperty("user.home");
|
String userHome = System.getProperty("user.home");
|
||||||
System.setProperty("user.home",
|
System.setProperty("user.home",
|
||||||
new File("src/test/resources/user-home").getAbsolutePath());
|
new File("src/test/resources/user-home").getAbsolutePath());
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class RemoteDevToolsAutoConfigurationTests {
|
||||||
loadContext("spring.devtools.remote.secret:supersecret",
|
loadContext("spring.devtools.remote.secret:supersecret",
|
||||||
"spring.devtools.remote.restart.enabled:false");
|
"spring.devtools.remote.restart.enabled:false");
|
||||||
this.thrown.expect(NoSuchBeanDefinitionException.class);
|
this.thrown.expect(NoSuchBeanDefinitionException.class);
|
||||||
this.context.getBean("remoteRestartHanderMapper");
|
this.context.getBean("remoteRestartHandlerMapper");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -193,7 +193,7 @@ public class RemoteDevToolsAutoConfigurationTests {
|
||||||
loadContext("spring.devtools.remote.secret:supersecret",
|
loadContext("spring.devtools.remote.secret:supersecret",
|
||||||
"spring.devtools.remote.debug.enabled:false");
|
"spring.devtools.remote.debug.enabled:false");
|
||||||
this.thrown.expect(NoSuchBeanDefinitionException.class);
|
this.thrown.expect(NoSuchBeanDefinitionException.class);
|
||||||
this.context.getBean("remoteDebugHanderMapper");
|
this.context.getBean("remoteDebugHandlerMapper");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -223,7 +223,7 @@ public class HttpTunnelServerTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void requestRecievedOutOfOrder() throws Exception {
|
public void requestReceivedOutOfOrder() throws Exception {
|
||||||
MockHttpConnection h1 = new MockHttpConnection();
|
MockHttpConnection h1 = new MockHttpConnection();
|
||||||
MockHttpConnection h2 = new MockHttpConnection("1+2", 1);
|
MockHttpConnection h2 = new MockHttpConnection("1+2", 1);
|
||||||
MockHttpConnection h3 = new MockHttpConnection("+3", 2);
|
MockHttpConnection h3 = new MockHttpConnection("+3", 2);
|
||||||
|
|
Loading…
Reference in New Issue