OPEN - issue BATCH-324: Step as factory for StepExecutor
http://jira.springframework.org/browse/BATCH-324 Consolidate changes and remove unnecessary methods from interfaces
This commit is contained in:
@@ -18,8 +18,6 @@ package org.springframework.batch.core.configuration;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.core.domain.StepSupport;
|
||||
import org.springframework.batch.core.tasklet.Tasklet;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
@@ -53,20 +51,6 @@ public class StepSupportTests extends TestCase {
|
||||
assertEquals(10, configuration.getStartLimit());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link org.springframework.batch.core.domain.StepSupport#getTasklet()}.
|
||||
*/
|
||||
public void testGetTasklet() {
|
||||
assertEquals(null, configuration.getTasklet());
|
||||
Tasklet tasklet = new Tasklet() {
|
||||
public ExitStatus execute() throws Exception {
|
||||
return ExitStatus.FINISHED;
|
||||
}
|
||||
};
|
||||
configuration.setTasklet(tasklet);
|
||||
assertEquals(tasklet, configuration.getTasklet());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link org.springframework.batch.core.domain.StepSupport#isAllowStartIfComplete()}.
|
||||
*/
|
||||
@@ -76,4 +60,17 @@ public class StepSupportTests extends TestCase {
|
||||
assertEquals(true, configuration.isAllowStartIfComplete());
|
||||
}
|
||||
|
||||
public void testUnsuccessfulWrongConfiguration() throws Exception {
|
||||
try {
|
||||
new StepSupport().createStepExecutor();
|
||||
fail("Expected UnsupportedOperationException");
|
||||
} catch (UnsupportedOperationException e) {
|
||||
// expected
|
||||
assertTrue(
|
||||
"Error message does not contain SimpleStep: "
|
||||
+ e.getMessage(), e.getMessage().indexOf(
|
||||
"SimpleStep") >= 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user