Java Doc for AbstractTransactionalDataSourceSpringContextTests.java in  » J2EE » spring-framework-2.0.6 » org » springframework » test » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.test 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.test.ConditionalTestCase
   org.springframework.test.AbstractSpringContextTests
      org.springframework.test.AbstractSingleSpringContextTests
         org.springframework.test.AbstractDependencyInjectionSpringContextTests
            org.springframework.test.AbstractTransactionalSpringContextTests
               org.springframework.test.AbstractTransactionalDataSourceSpringContextTests

All known Subclasses:   org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests,
AbstractTransactionalDataSourceSpringContextTests
abstract public class AbstractTransactionalDataSourceSpringContextTests extends AbstractTransactionalSpringContextTests (Code)
Subclass of AbstractTransactionalSpringContextTests that adds some convenience functionality for JDBC access. Expects a javax.sql.DataSource bean to be defined in the Spring application context.

This class exposes a org.springframework.jdbc.core.JdbcTemplate and provides an easy way to delete from the database in a new transaction.
author:
   Rod Johnson
author:
   Juergen Hoeller
since:
   1.1.1
See Also:   AbstractTransactionalDataSourceSpringContextTests.setDataSource(javax.sql.DataSource)
See Also:   AbstractTransactionalDataSourceSpringContextTests.getJdbcTemplate()



Field Summary
protected  JdbcTemplatejdbcTemplate
    

Constructor Summary
public  AbstractTransactionalDataSourceSpringContextTests()
     Default constructor for AbstractTransactionalDataSourceSpringContextTests.
public  AbstractTransactionalDataSourceSpringContextTests(String name)
     Constructor for AbstractTransactionalDataSourceSpringContextTests with a JUnit name.

Method Summary
protected  intcountRowsInTable(String tableName)
    
protected  voiddeleteFromTables(String[] names)
     Convenient method to delete all rows from these tables.
protected  voidexecuteSqlScript(String sqlResourcePath, boolean continueOnError)
     Execute the given SQL script.
final public  JdbcTemplategetJdbcTemplate()
     Return the JdbcTemplate that this base class manages.
final protected  voidsetComplete()
     Overridden to prevent the transaction committing if a number of tables have been cleared, as a defensive measure against accidental permanent wiping of a database.
public  voidsetDataSource(DataSource dataSource)
     Setter: DataSource is provided by Dependency Injection.

Field Detail
jdbcTemplate
protected JdbcTemplate jdbcTemplate(Code)




Constructor Detail
AbstractTransactionalDataSourceSpringContextTests
public AbstractTransactionalDataSourceSpringContextTests()(Code)
Default constructor for AbstractTransactionalDataSourceSpringContextTests.



AbstractTransactionalDataSourceSpringContextTests
public AbstractTransactionalDataSourceSpringContextTests(String name)(Code)
Constructor for AbstractTransactionalDataSourceSpringContextTests with a JUnit name.




Method Detail
countRowsInTable
protected int countRowsInTable(String tableName)(Code)
Count the rows in the given table
Parameters:
  tableName - table name to count rows in the number of rows in the table



deleteFromTables
protected void deleteFromTables(String[] names)(Code)
Convenient method to delete all rows from these tables. Calling this method will make avoidance of rollback by calling setComplete() impossible.
See Also:   AbstractTransactionalDataSourceSpringContextTests.setComplete



executeSqlScript
protected void executeSqlScript(String sqlResourcePath, boolean continueOnError) throws DataAccessException(Code)
Execute the given SQL script. Will be rolled back by default, according to the fate of the current transaction.
Parameters:
  sqlResourcePath - Spring resource path for the SQL script.Should normally be loaded by classpath. There should be one statementper line. Any semicolons will be removed.Do not use this method to execute DDL if you expect rollback.
Parameters:
  continueOnError - whether or not to continue without throwingan exception in the event of an error
throws:
  DataAccessException - if there is an error executing a statementand continueOnError was false



getJdbcTemplate
final public JdbcTemplate getJdbcTemplate()(Code)
Return the JdbcTemplate that this base class manages.



setComplete
final protected void setComplete()(Code)
Overridden to prevent the transaction committing if a number of tables have been cleared, as a defensive measure against accidental permanent wiping of a database.
See Also:   org.springframework.test.AbstractTransactionalSpringContextTests.setComplete



setDataSource
public void setDataSource(DataSource dataSource)(Code)
Setter: DataSource is provided by Dependency Injection.



Fields inherited from org.springframework.test.AbstractTransactionalSpringContextTests
protected TransactionDefinition transactionDefinition(Code)(Java Doc)
protected PlatformTransactionManager transactionManager(Code)(Java Doc)
protected TransactionStatus transactionStatus(Code)(Java Doc)

Methods inherited from org.springframework.test.AbstractTransactionalSpringContextTests
protected void endTransaction()(Code)(Java Doc)
protected void onSetUp() throws Exception(Code)(Java Doc)
protected void onSetUpBeforeTransaction() throws Exception(Code)(Java Doc)
protected void onSetUpInTransaction() throws Exception(Code)(Java Doc)
protected void onTearDown() throws Exception(Code)(Java Doc)
protected void onTearDownAfterTransaction() throws Exception(Code)(Java Doc)
protected void onTearDownInTransaction() throws Exception(Code)(Java Doc)
protected void preventTransaction()(Code)(Java Doc)
protected void setComplete()(Code)(Java Doc)
public void setDefaultRollback(boolean defaultRollback)(Code)(Java Doc)
protected void setTransactionDefinition(TransactionDefinition customDefinition)(Code)(Java Doc)
public void setTransactionManager(PlatformTransactionManager transactionManager)(Code)(Java Doc)
protected void startNewTransaction() throws TransactionException(Code)(Java Doc)

Fields inherited from org.springframework.test.AbstractDependencyInjectionSpringContextTests
final public static int AUTOWIRE_BY_NAME(Code)(Java Doc)
final public static int AUTOWIRE_BY_TYPE(Code)(Java Doc)
final public static int AUTOWIRE_NO(Code)(Java Doc)

Methods inherited from org.springframework.test.AbstractDependencyInjectionSpringContextTests
final public int getAutowireMode()(Code)(Java Doc)
protected void injectDependencies() throws Exception(Code)(Java Doc)
final public boolean isDependencyCheck()(Code)(Java Doc)
final public boolean isPopulateProtectedVariables()(Code)(Java Doc)
protected void prepareTestInstance() throws Exception(Code)(Java Doc)
final public void setAutowireMode(int autowireMode)(Code)(Java Doc)
final public void setDependencyCheck(boolean dependencyCheck)(Code)(Java Doc)
final public void setPopulateProtectedVariables(boolean populateFields)(Code)(Java Doc)

Fields inherited from org.springframework.test.AbstractSingleSpringContextTests
protected ConfigurableApplicationContext applicationContext(Code)(Java Doc)

Methods inherited from org.springframework.test.AbstractSingleSpringContextTests
protected Object contextKey()(Code)(Java Doc)
protected ConfigurableApplicationContext createApplicationContext(String[] locations)(Code)(Java Doc)
protected void customizeBeanFactory(DefaultListableBeanFactory beanFactory)(Code)(Java Doc)
final public ConfigurableApplicationContext getApplicationContext()(Code)(Java Doc)
protected String[] getConfigLocations()(Code)(Java Doc)
protected String getConfigPath()(Code)(Java Doc)
protected String[] getConfigPaths()(Code)(Java Doc)
final public int getLoadCount()(Code)(Java Doc)
protected ConfigurableApplicationContext loadContext(Object key) throws Exception(Code)(Java Doc)
protected ConfigurableApplicationContext loadContextLocations(String[] locations) throws Exception(Code)(Java Doc)
protected void onSetUp() throws Exception(Code)(Java Doc)
protected void onTearDown() throws Exception(Code)(Java Doc)
protected void prepareTestInstance() throws Exception(Code)(Java Doc)
protected void setDirty()(Code)(Java Doc)
final protected void setUp() throws Exception(Code)(Java Doc)
final protected void tearDown() throws Exception(Code)(Java Doc)

Methods inherited from org.springframework.test.AbstractSpringContextTests
final public void addContext(Object key, ConfigurableApplicationContext context)(Code)(Java Doc)
protected String contextKeyString(Object contextKey)(Code)(Java Doc)
final protected ConfigurableApplicationContext getContext(Object key) throws Exception(Code)(Java Doc)
final protected boolean hasCachedContext(Object contextKey)(Code)(Java Doc)
abstract protected ConfigurableApplicationContext loadContext(Object key) throws Exception(Code)(Java Doc)
final protected void setDirty(Object contextKey)(Code)(Java Doc)

Fields inherited from org.springframework.test.ConditionalTestCase
final protected Log logger(Code)(Java Doc)

Methods inherited from org.springframework.test.ConditionalTestCase
public static int getDisabledTestCount()(Code)(Java Doc)
protected boolean isDisabledInThisEnvironment(String testMethodName)(Code)(Java Doc)
protected int recordDisabled()(Code)(Java Doc)
public void runBare() throws Throwable(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.