org.springframework.batch.sample
Class AbstractValidatingBatchLauncherTests

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.AbstractValidatingBatchLauncherTests
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractCustomerCreditIncreaseTests, BeanWrapperMapperSampleJobFunctionalTests, CompositeItemWriterSampleFunctionalTests, DelegatingJobFunctionalTests, FixedLengthImportJobFunctionalTests, FootballJobFunctionalTests, JobExecutionContextSampleFunctionalTests, MultilineJobFunctionalTests, MultilineOrderJobFunctionalTests, ParallelJobFunctionalTests, RetrySampleFunctionalTests, SkipSampleFunctionalTests, TaskletJobFunctionalTests, TradeJobFunctionalTests, XmlStaxJobFunctionalTests

public abstract class AbstractValidatingBatchLauncherTests
extends AbstractBatchLauncherTests

Abstract TestCase that automatically starts a Spring (@link Lifecycle) after obtaining it automatically via autowiring by type. It should be noted the getConfigLocations must be implemented for dependency injection to work properly.

Author:
Lucas Ward
See Also:
AbstractDependencyInjectionSpringContextTests

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
AbstractValidatingBatchLauncherTests()
           
 
Method Summary
 void testLaunchJob()
           
protected abstract  void validatePostConditions()
          Make sure job did what it was expected to do.
protected  void validatePreConditions()
          Make sure input data meets expectations
 
Methods inherited from class org.springframework.batch.sample.AbstractBatchLauncherTests
getConfigLocations, getJob, getJobName, setJob, setJobParameters, setLauncher
 
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, onTearDown, 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

AbstractValidatingBatchLauncherTests

public AbstractValidatingBatchLauncherTests()
Method Detail

testLaunchJob

public void testLaunchJob()
                   throws Exception
Overrides:
testLaunchJob in class AbstractBatchLauncherTests
Throws:
Exception

validatePreConditions

protected void validatePreConditions()
                              throws Exception
Make sure input data meets expectations

Throws:
Exception

validatePostConditions

protected abstract void validatePostConditions()
                                        throws Exception
Make sure job did what it was expected to do.

Throws:
Exception


Copyright © 2008 SpringSource. All Rights Reserved.