Restructure 'bootstrap' to use 'zero'

This commit is contained in:
Phillip Webb
2013-07-05 16:44:24 -07:00
parent d039822064
commit 261955c50b
443 changed files with 1361 additions and 1774 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.batch;
package org.springframework.zero.sample.batch;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
@@ -26,17 +26,17 @@ import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.bootstrap.SpringApplication;
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
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
@EnableBatchProcessing
public class BatchBootstrapApplication {
public class SampleBatchApplication {
@Autowired
private JobBuilderFactory jobs;
@@ -69,6 +69,6 @@ public class BatchBootstrapApplication {
// System.exit is common for Batch applications since the exit code can be used to
// drive a workflow
System.exit(SpringApplication.exit(SpringApplication.run(
BatchBootstrapApplication.class, args)));
SampleBatchApplication.class, args)));
}
}

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.bootstrap.sample.batch;
package org.springframework.zero.sample.batch;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
@@ -21,12 +21,13 @@ import java.io.PrintStream;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.bootstrap.SpringApplication;
import org.springframework.zero.SpringApplication;
import org.springframework.zero.sample.batch.SampleBatchApplication;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class BatchBootstrapApplicationTests {
public class SampleBatchApplicationTests {
private PrintStream savedOutput;
private ByteArrayOutputStream output;
@@ -51,7 +52,7 @@ public class BatchBootstrapApplicationTests {
@Test
public void testDefaultSettings() throws Exception {
assertEquals(0, SpringApplication.exit(SpringApplication
.run(BatchBootstrapApplication.class)));
.run(SampleBatchApplication.class)));
String output = getOutput();
assertTrue("Wrong output: " + output,
output.contains("completed with the following parameters"));