org.springframework.batch.sample
Class AbstractCustomerCreditIncreaseTests

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
                                  extended by org.springframework.batch.sample.AbstractCustomerCreditIncreaseTests
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
BatchSqlUpdateJobFunctionalTests, HibernateJobFunctionalTests, IbatisJobFunctionalTests

public abstract class AbstractCustomerCreditIncreaseTests
extends AbstractValidatingBatchLauncherTests

Test case for jobs that are expected to update customer credit value by fixed amount.

Author:
Robert Kasanicky, Dave Syer

Field Summary
protected static String ID_COLUMN
           
protected  JdbcOperations jdbcTemplate
           
protected  PlatformTransactionManager transactionManager
           
 
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
AbstractCustomerCreditIncreaseTests()
           
 
Method Summary
protected  void checkMatches(List matches)
           
protected  int getExpectedMatches()
           
 void setJdbcTemplate(JdbcOperations jdbcTemplate)
           
 void setTransactionManager(PlatformTransactionManager transactionManager)
          Public setter for the PlatformTransactionManager.
protected  void validatePostConditions()
          Credit was increased by CREDIT_INCREASE
protected  void validatePreConditions()
          All customers have the same credit
 
Methods inherited from class org.springframework.batch.sample.AbstractValidatingBatchLauncherTests
testLaunchJob
 
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
 

Field Detail

jdbcTemplate

protected JdbcOperations jdbcTemplate

transactionManager

protected PlatformTransactionManager transactionManager

ID_COLUMN

protected static final String ID_COLUMN
See Also:
Constant Field Values
Constructor Detail

AbstractCustomerCreditIncreaseTests

public AbstractCustomerCreditIncreaseTests()
Method Detail

setJdbcTemplate

public void setJdbcTemplate(JdbcOperations jdbcTemplate)
Parameters:
jdbcTemplate -

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)
Public setter for the PlatformTransactionManager.

Parameters:
transactionManager - the transactionManager to set

validatePreConditions

protected void validatePreConditions()
                              throws Exception
All customers have the same credit

Overrides:
validatePreConditions in class AbstractValidatingBatchLauncherTests
Throws:
Exception

validatePostConditions

protected void validatePostConditions()
                               throws Exception
Credit was increased by CREDIT_INCREASE

Specified by:
validatePostConditions in class AbstractValidatingBatchLauncherTests
Throws:
Exception

checkMatches

protected void checkMatches(List matches)
Parameters:
matches -

getExpectedMatches

protected int getExpectedMatches()
Returns:
the expected number of matches in the updated credits.


Copyright © 2008 SpringSource. All Rights Reserved.