Restructure 'bootstrap' to use 'zero'
This commit is contained in:
@@ -14,20 +14,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.sample.tomcat;
|
||||
package org.springframework.zero.sample.tomcat;
|
||||
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
import org.springframework.zero.context.annotation.EnableAutoConfiguration;
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan
|
||||
public class TomcatBootstrapApplication {
|
||||
public class SampleTomcatApplication {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
SpringApplication.run(TomcatBootstrapApplication.class, args);
|
||||
SpringApplication.run(SampleTomcatApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.sample.tomcat.service;
|
||||
package org.springframework.zero.sample.tomcat.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.sample.tomcat.web;
|
||||
package org.springframework.zero.sample.tomcat.web;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.bootstrap.sample.tomcat.service.HelloWorldService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.zero.sample.tomcat.service.HelloWorldService;
|
||||
|
||||
@Controller
|
||||
public class SampleController {
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.bootstrap.sample.tomcat;
|
||||
package org.springframework.zero.sample.tomcat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.Callable;
|
||||
@@ -9,12 +9,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.bootstrap.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.bootstrap.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
|
||||
import org.springframework.bootstrap.autoconfigure.web.WebMvcAutoConfiguration;
|
||||
import org.springframework.bootstrap.sample.tomcat.service.HelloWorldService;
|
||||
import org.springframework.bootstrap.sample.tomcat.web.SampleController;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -24,6 +18,13 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
import org.springframework.zero.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.zero.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
|
||||
import org.springframework.zero.autoconfigure.web.WebMvcAutoConfiguration;
|
||||
import org.springframework.zero.sample.tomcat.SampleTomcatApplication;
|
||||
import org.springframework.zero.sample.tomcat.service.HelloWorldService;
|
||||
import org.springframework.zero.sample.tomcat.web.SampleController;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -31,9 +32,8 @@ import static org.junit.Assert.assertEquals;
|
||||
* Basic integration tests for demo application.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public class NonAutoConfigurationBootstrapApplicationTests {
|
||||
public class NonAutoConfigurationSampleTomcatApplicationTests {
|
||||
|
||||
private static ConfigurableApplicationContext context;
|
||||
|
||||
@@ -41,10 +41,10 @@ public class NonAutoConfigurationBootstrapApplicationTests {
|
||||
@Import({ EmbeddedServletContainerAutoConfiguration.class,
|
||||
WebMvcAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class })
|
||||
@ComponentScan(basePackageClasses = { SampleController.class, HelloWorldService.class })
|
||||
public static class NonAutoConfigurationBootstrapApplication {
|
||||
public static class NonAutoConfigurationSampleTomcatApplication {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
SpringApplication.run(TomcatBootstrapApplication.class, args);
|
||||
SpringApplication.run(SampleTomcatApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class NonAutoConfigurationBootstrapApplicationTests {
|
||||
@Override
|
||||
public ConfigurableApplicationContext call() throws Exception {
|
||||
return (ConfigurableApplicationContext) SpringApplication
|
||||
.run(NonAutoConfigurationBootstrapApplication.class);
|
||||
.run(NonAutoConfigurationSampleTomcatApplication.class);
|
||||
}
|
||||
});
|
||||
context = future.get(10, TimeUnit.SECONDS);
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.bootstrap.sample.tomcat;
|
||||
package org.springframework.zero.sample.tomcat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.Callable;
|
||||
@@ -9,13 +9,13 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -23,9 +23,8 @@ import static org.junit.Assert.assertEquals;
|
||||
* Basic integration tests for demo application.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public class TomcatBootstrapApplicationTests {
|
||||
public class SampleTomcatApplicationTests {
|
||||
|
||||
private static ConfigurableApplicationContext context;
|
||||
|
||||
@@ -37,7 +36,7 @@ public class TomcatBootstrapApplicationTests {
|
||||
@Override
|
||||
public ConfigurableApplicationContext call() throws Exception {
|
||||
return (ConfigurableApplicationContext) SpringApplication
|
||||
.run(TomcatBootstrapApplication.class);
|
||||
.run(SampleTomcatApplication.class);
|
||||
}
|
||||
});
|
||||
context = future.get(10, TimeUnit.SECONDS);
|
||||
Reference in New Issue
Block a user