org.springframework.batch.sample
Class RestartFunctionalTests

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.springframework.test.ConditionalTestCase
              extended by org.springframework.test.AbstractSpringContextTests
                  extended by org.springframework.test.AbstractSingleSpringContextTests
                      extended by org.springframework.test.AbstractDependencyInjectionSpringContextTests
                          extended by org.springframework.batch.sample.AbstractBatchLauncherTests
                              extended by org.springframework.batch.sample.RestartFunctionalTests
All Implemented Interfaces:
junit.framework.Test

public class RestartFunctionalTests
extends AbstractBatchLauncherTests

Simple restart scenario.

Author:
Robert Kasanicky, Dave Syer

Field Summary
 
Fields inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO
 
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
 
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
 
Constructor Summary
RestartFunctionalTests()
           
 
Method Summary
protected  void onTearDown()
           
 void setJdbcTemplate(JdbcOperations jdbcTemplate)
          Public setter for the jdbcTemplate.
 void testRestart()
          Job fails on first run, because the module throws exception after processing more than half of the input.
 
Methods inherited from class org.springframework.batch.sample.AbstractBatchLauncherTests
getConfigLocations, getJob, getJobName, setJob, setJobParameters, setLauncher, testLaunchJob
 
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
getAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariables
 
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
contextKey, createApplicationContext, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, onSetUp, prepareApplicationContext, setDirty, setUp, tearDown
 
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
 
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled, runBare
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RestartFunctionalTests

public RestartFunctionalTests()
Method Detail

setJdbcTemplate

public void setJdbcTemplate(JdbcOperations jdbcTemplate)
Public setter for the jdbcTemplate.

Parameters:
jdbcTemplate - the jdbcTemplate to set

onTearDown

protected void onTearDown()
                   throws Exception
Overrides:
onTearDown in class AbstractSingleSpringContextTests
Throws:
Exception

testRestart

public void testRestart()
                 throws Exception
Job fails on first run, because the module throws exception after processing more than half of the input. On the second run, the job should finish successfully, because it continues execution where the previous run stopped (module throws exception after fixed number of processed records).

Throws:
Exception


Copyright © 2008 SpringSource. All Rights Reserved.