Restructure 'bootstrap' to use 'zero'
This commit is contained in:
@@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.sample.xml;
|
||||
package org.springframework.zero.sample.xml;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.bootstrap.CommandLineRunner;
|
||||
import org.springframework.bootstrap.SpringApplication;
|
||||
import org.springframework.bootstrap.sample.xml.service.HelloWorldService;
|
||||
import org.springframework.zero.CommandLineRunner;
|
||||
import org.springframework.zero.SpringApplication;
|
||||
import org.springframework.zero.sample.xml.service.HelloWorldService;
|
||||
|
||||
public class XmlBootstrapApplication implements CommandLineRunner {
|
||||
public class SampleSpringXmlApplication implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private HelloWorldService helloWorldService;
|
||||
@@ -32,7 +32,7 @@ public class XmlBootstrapApplication implements CommandLineRunner {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
// TODO: to make this a pure XML example, will need <bootstrap:auto-configure/>
|
||||
// TODO: to make this a pure XML example, will need <zero:auto-configure/>
|
||||
SpringApplication.run("classpath:/META-INF/application-context.xml", args);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.sample.xml.service;
|
||||
package org.springframework.zero.sample.xml.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -8,7 +8,7 @@
|
||||
<context:annotation-config/>
|
||||
<context:property-placeholder/>
|
||||
|
||||
<bean id="helloService" class="org.springframework.bootstrap.sample.xml.service.HelloWorldService"/>
|
||||
<bean id="application" class="org.springframework.bootstrap.sample.xml.XmlBootstrapApplication"/>
|
||||
<bean id="helloService" class="org.springframework.zero.sample.xml.service.HelloWorldService"/>
|
||||
<bean id="application" class="org.springframework.zero.sample.xml.SampleSpringXmlApplication"/>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.springframework.bootstrap.sample.xml;
|
||||
package org.springframework.zero.sample.xml;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
@@ -6,10 +6,11 @@ import java.io.PrintStream;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.zero.sample.xml.SampleSpringXmlApplication;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class XmlBootstrapApplicationTests {
|
||||
public class SampleSpringXmlApplicationTests {
|
||||
|
||||
private static PrintStream savedOutput;
|
||||
private static ByteArrayOutputStream output;
|
||||
@@ -32,7 +33,7 @@ public class XmlBootstrapApplicationTests {
|
||||
|
||||
@Test
|
||||
public void testDefaultSettings() throws Exception {
|
||||
XmlBootstrapApplication.main(new String[0]);
|
||||
SampleSpringXmlApplication.main(new String[0]);
|
||||
String output = getOutput();
|
||||
assertTrue("Wrong output: " + output, output.contains("Hello World"));
|
||||
}
|
||||
Reference in New Issue
Block a user