mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
[BS-157] Fix misnamed method
Fix typo in EmbeddedServletContainerFactory. e enter the commit message for your changes. Lines starting
This commit is contained in:
parent
018231d20a
commit
f8c20919f9
@ -159,7 +159,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets {@link ServletContextInitializer} that should be applied in addition to
|
* Sets {@link ServletContextInitializer} that should be applied in addition to
|
||||||
* {@link #getEmbdeddedServletContainer(ServletContextInitializer...)} parameters.
|
* {@link #getEmbeddedServletContainer(ServletContextInitializer...)} parameters.
|
||||||
* This method will replace any previously set or added initializers.
|
* This method will replace any previously set or added initializers.
|
||||||
* @param initializers the initializers to set
|
* @param initializers the initializers to set
|
||||||
* @see #addInitializers
|
* @see #addInitializers
|
||||||
@ -172,7 +172,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add {@link ServletContextInitializer}s to those that should be applied in addition
|
* Add {@link ServletContextInitializer}s to those that should be applied in addition
|
||||||
* to {@link #getEmbdeddedServletContainer(ServletContextInitializer...)} parameters.
|
* to {@link #getEmbeddedServletContainer(ServletContextInitializer...)} parameters.
|
||||||
* @param initializers the initializers to add
|
* @param initializers the initializers to add
|
||||||
* @see #setInitializers
|
* @see #setInitializers
|
||||||
* @see #getInitializers
|
* @see #getInitializers
|
||||||
@ -185,7 +185,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a mutable list of {@link ServletContextInitializer} that should be applied
|
* Returns a mutable list of {@link ServletContextInitializer} that should be applied
|
||||||
* in addition to {@link #getEmbdeddedServletContainer(ServletContextInitializer...)}
|
* in addition to {@link #getEmbeddedServletContainer(ServletContextInitializer...)}
|
||||||
* parameters.
|
* parameters.
|
||||||
* @return the initializers
|
* @return the initializers
|
||||||
*/
|
*/
|
||||||
|
@ -40,7 +40,7 @@ public interface EmbeddedServletContainerFactory {
|
|||||||
* @return a fully configured and started {@link EmbeddedServletContainer}
|
* @return a fully configured and started {@link EmbeddedServletContainer}
|
||||||
* @see EmbeddedServletContainer#stop()
|
* @see EmbeddedServletContainer#stop()
|
||||||
*/
|
*/
|
||||||
EmbeddedServletContainer getEmbdeddedServletContainer(
|
EmbeddedServletContainer getEmbeddedServletContainer(
|
||||||
ServletContextInitializer... initializers);
|
ServletContextInitializer... initializers);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ public class EmbeddedWebApplicationContext extends GenericWebApplicationContext
|
|||||||
if (this.embeddedServletContainer == null && getServletContext() == null) {
|
if (this.embeddedServletContainer == null && getServletContext() == null) {
|
||||||
EmbeddedServletContainerFactory containerFactory = getEmbeddedServletContainerFactory();
|
EmbeddedServletContainerFactory containerFactory = getEmbeddedServletContainerFactory();
|
||||||
this.embeddedServletContainer = containerFactory
|
this.embeddedServletContainer = containerFactory
|
||||||
.getEmbdeddedServletContainer(getSelfInitializer());
|
.getEmbeddedServletContainer(getSelfInitializer());
|
||||||
} else if (getServletContext() != null) {
|
} else if (getServletContext() != null) {
|
||||||
try {
|
try {
|
||||||
getSelfInitializer().onStartup(getServletContext());
|
getSelfInitializer().onStartup(getServletContext());
|
||||||
|
@ -94,7 +94,7 @@ public class JettyEmbeddedServletContainerFactory extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EmbeddedServletContainer getEmbdeddedServletContainer(
|
public EmbeddedServletContainer getEmbeddedServletContainer(
|
||||||
ServletContextInitializer... initializers) {
|
ServletContextInitializer... initializers) {
|
||||||
if (getPort() == 0) {
|
if (getPort() == 0) {
|
||||||
return EmbeddedServletContainer.NONE;
|
return EmbeddedServletContainer.NONE;
|
||||||
|
@ -105,7 +105,7 @@ public class TomcatEmbeddedServletContainerFactory extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EmbeddedServletContainer getEmbdeddedServletContainer(
|
public EmbeddedServletContainer getEmbeddedServletContainer(
|
||||||
ServletContextInitializer... initializers) {
|
ServletContextInitializer... initializers) {
|
||||||
if (getPort() == 0) {
|
if (getPort() == 0) {
|
||||||
return EmbeddedServletContainer.NONE;
|
return EmbeddedServletContainer.NONE;
|
||||||
@ -339,7 +339,7 @@ public class TomcatEmbeddedServletContainerFactory extends
|
|||||||
return new TomcatEmbeddedServletContainerFactory() {
|
return new TomcatEmbeddedServletContainerFactory() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EmbeddedServletContainer getEmbdeddedServletContainer(
|
public EmbeddedServletContainer getEmbeddedServletContainer(
|
||||||
ServletContextInitializer... initializers) {
|
ServletContextInitializer... initializers) {
|
||||||
|
|
||||||
if (getPort() == 0) {
|
if (getPort() == 0) {
|
||||||
|
@ -81,7 +81,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
public void startServlet() throws Exception {
|
public void startServlet() throws Exception {
|
||||||
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
||||||
this.container = factory
|
this.container = factory
|
||||||
.getEmbdeddedServletContainer(exampleServletRegistration());
|
.getEmbeddedServletContainer(exampleServletRegistration());
|
||||||
assertThat(getResponse("http://localhost:8080/hello"), equalTo("Hello World"));
|
assertThat(getResponse("http://localhost:8080/hello"), equalTo("Hello World"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
||||||
factory.setPort(0);
|
factory.setPort(0);
|
||||||
this.container = factory
|
this.container = factory
|
||||||
.getEmbdeddedServletContainer(exampleServletRegistration());
|
.getEmbeddedServletContainer(exampleServletRegistration());
|
||||||
this.thrown.expect(ConnectException.class);
|
this.thrown.expect(ConnectException.class);
|
||||||
this.thrown.expectMessage("Connection refused");
|
this.thrown.expectMessage("Connection refused");
|
||||||
getResponse("http://localhost:8080/hello");
|
getResponse("http://localhost:8080/hello");
|
||||||
@ -100,7 +100,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
public void stopServlet() throws Exception {
|
public void stopServlet() throws Exception {
|
||||||
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
||||||
this.container = factory
|
this.container = factory
|
||||||
.getEmbdeddedServletContainer(exampleServletRegistration());
|
.getEmbeddedServletContainer(exampleServletRegistration());
|
||||||
this.container.stop();
|
this.container.stop();
|
||||||
this.thrown.expect(ConnectException.class);
|
this.thrown.expect(ConnectException.class);
|
||||||
getResponse("http://localhost:8080/hello");
|
getResponse("http://localhost:8080/hello");
|
||||||
@ -111,7 +111,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
public void restartWithKeepAlive() throws Exception {
|
public void restartWithKeepAlive() throws Exception {
|
||||||
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
||||||
this.container = factory
|
this.container = factory
|
||||||
.getEmbdeddedServletContainer(exampleServletRegistration());
|
.getEmbeddedServletContainer(exampleServletRegistration());
|
||||||
|
|
||||||
MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
|
MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
|
||||||
HttpClient client = new HttpClient(connectionManager);
|
HttpClient client = new HttpClient(connectionManager);
|
||||||
@ -121,7 +121,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
|
|
||||||
this.container.stop();
|
this.container.stop();
|
||||||
this.container = factory
|
this.container = factory
|
||||||
.getEmbdeddedServletContainer(exampleServletRegistration());
|
.getEmbeddedServletContainer(exampleServletRegistration());
|
||||||
|
|
||||||
GetMethod get2 = new GetMethod("http://localhost:8080/hello");
|
GetMethod get2 = new GetMethod("http://localhost:8080/hello");
|
||||||
assertThat(client.executeMethod(get2), equalTo(200));
|
assertThat(client.executeMethod(get2), equalTo(200));
|
||||||
@ -131,7 +131,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
@Test
|
@Test
|
||||||
public void startServletAndFilter() throws Exception {
|
public void startServletAndFilter() throws Exception {
|
||||||
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
||||||
this.container = factory.getEmbdeddedServletContainer(
|
this.container = factory.getEmbeddedServletContainer(
|
||||||
exampleServletRegistration(), new FilterRegistrationBean(
|
exampleServletRegistration(), new FilterRegistrationBean(
|
||||||
new ExampleFilter()));
|
new ExampleFilter()));
|
||||||
assertThat(getResponse("http://localhost:8080/hello"), equalTo("[Hello World]"));
|
assertThat(getResponse("http://localhost:8080/hello"), equalTo("[Hello World]"));
|
||||||
@ -143,7 +143,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
||||||
final Date[] date = new Date[1];
|
final Date[] date = new Date[1];
|
||||||
this.container = factory
|
this.container = factory
|
||||||
.getEmbdeddedServletContainer(new ServletContextInitializer() {
|
.getEmbeddedServletContainer(new ServletContextInitializer() {
|
||||||
@Override
|
@Override
|
||||||
public void onStartup(ServletContext servletContext)
|
public void onStartup(ServletContext servletContext)
|
||||||
throws ServletException {
|
throws ServletException {
|
||||||
@ -163,7 +163,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
||||||
factory.setPort(8081);
|
factory.setPort(8081);
|
||||||
this.container = factory
|
this.container = factory
|
||||||
.getEmbdeddedServletContainer(exampleServletRegistration());
|
.getEmbeddedServletContainer(exampleServletRegistration());
|
||||||
assertThat(getResponse("http://localhost:8081/hello"), equalTo("Hello World"));
|
assertThat(getResponse("http://localhost:8081/hello"), equalTo("Hello World"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
||||||
factory.setContextPath("/say");
|
factory.setContextPath("/say");
|
||||||
this.container = factory
|
this.container = factory
|
||||||
.getEmbdeddedServletContainer(exampleServletRegistration());
|
.getEmbeddedServletContainer(exampleServletRegistration());
|
||||||
assertThat(getResponse("http://localhost:8080/say/hello"), equalTo("Hello World"));
|
assertThat(getResponse("http://localhost:8080/say/hello"), equalTo("Hello World"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
public void doubleStop() throws Exception {
|
public void doubleStop() throws Exception {
|
||||||
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
ConfigurableEmbeddedServletContainerFactory factory = getFactory();
|
||||||
this.container = factory
|
this.container = factory
|
||||||
.getEmbdeddedServletContainer(exampleServletRegistration());
|
.getEmbeddedServletContainer(exampleServletRegistration());
|
||||||
this.container.stop();
|
this.container.stop();
|
||||||
this.container.stop();
|
this.container.stop();
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
}
|
}
|
||||||
factory.setInitializers(Arrays.asList(initializers[2], initializers[3]));
|
factory.setInitializers(Arrays.asList(initializers[2], initializers[3]));
|
||||||
factory.addInitializers(initializers[4], initializers[5]);
|
factory.addInitializers(initializers[4], initializers[5]);
|
||||||
this.container = factory.getEmbdeddedServletContainer(initializers[0],
|
this.container = factory.getEmbeddedServletContainer(initializers[0],
|
||||||
initializers[1]);
|
initializers[1]);
|
||||||
InOrder ordered = inOrder((Object[]) initializers);
|
InOrder ordered = inOrder((Object[]) initializers);
|
||||||
for (ServletContextInitializer initializer : initializers) {
|
for (ServletContextInitializer initializer : initializers) {
|
||||||
@ -230,7 +230,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
|||||||
new FileWriter(this.temporaryFolder.newFile("test.txt")));
|
new FileWriter(this.temporaryFolder.newFile("test.txt")));
|
||||||
AbstractEmbeddedServletContainerFactory factory = getFactory();
|
AbstractEmbeddedServletContainerFactory factory = getFactory();
|
||||||
factory.setDocumentRoot(this.temporaryFolder.getRoot());
|
factory.setDocumentRoot(this.temporaryFolder.getRoot());
|
||||||
this.container = factory.getEmbdeddedServletContainer();
|
this.container = factory.getEmbeddedServletContainer();
|
||||||
assertThat(getResponse("http://localhost:8080/test.txt"), equalTo("test"));
|
assertThat(getResponse("http://localhost:8080/test.txt"), equalTo("test"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public class MockEmbeddedServletContainerFactory extends
|
|||||||
private MockEmbeddedServletContainer container;
|
private MockEmbeddedServletContainer container;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EmbeddedServletContainer getEmbdeddedServletContainer(
|
public EmbeddedServletContainer getEmbeddedServletContainer(
|
||||||
ServletContextInitializer... initializers) {
|
ServletContextInitializer... initializers) {
|
||||||
this.container = spy(new MockEmbeddedServletContainer(initializers, getPort()));
|
this.container = spy(new MockEmbeddedServletContainer(initializers, getPort()));
|
||||||
return this.container;
|
return this.container;
|
||||||
|
@ -47,7 +47,7 @@ public class JettyEmbeddedServletContainerFactoryTests extends
|
|||||||
}
|
}
|
||||||
factory.setConfigurations(Arrays.asList(configurations[0], configurations[1]));
|
factory.setConfigurations(Arrays.asList(configurations[0], configurations[1]));
|
||||||
factory.addConfigurations(configurations[2], configurations[3]);
|
factory.addConfigurations(configurations[2], configurations[3]);
|
||||||
this.container = factory.getEmbdeddedServletContainer();
|
this.container = factory.getEmbeddedServletContainer();
|
||||||
InOrder ordered = inOrder((Object[]) configurations);
|
InOrder ordered = inOrder((Object[]) configurations);
|
||||||
for (Configuration configuration : configurations) {
|
for (Configuration configuration : configurations) {
|
||||||
ordered.verify(configuration).configure((WebAppContext) anyObject());
|
ordered.verify(configuration).configure((WebAppContext) anyObject());
|
||||||
|
@ -48,7 +48,7 @@ public class TomcatEmbeddedServletContainerFactoryTests extends
|
|||||||
}
|
}
|
||||||
factory.setContextLifecycleListeners(Arrays.asList(listeners[0], listeners[1]));
|
factory.setContextLifecycleListeners(Arrays.asList(listeners[0], listeners[1]));
|
||||||
factory.addContextLifecycleListeners(listeners[2], listeners[3]);
|
factory.addContextLifecycleListeners(listeners[2], listeners[3]);
|
||||||
this.container = factory.getEmbdeddedServletContainer();
|
this.container = factory.getEmbeddedServletContainer();
|
||||||
InOrder ordered = inOrder((Object[]) listeners);
|
InOrder ordered = inOrder((Object[]) listeners);
|
||||||
for (LifecycleListener listener : listeners) {
|
for (LifecycleListener listener : listeners) {
|
||||||
ordered.verify(listener).lifecycleEvent((LifecycleEvent) anyObject());
|
ordered.verify(listener).lifecycleEvent((LifecycleEvent) anyObject());
|
||||||
|
Loading…
Reference in New Issue
Block a user