Java Doc for DDStepsSpringTestCase.java in  » Testing » DDSteps » org » ddsteps » spring » 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 » Testing » DDSteps » org.ddsteps.spring 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.ddsteps.spring.DDStepsSpringTestCase

All known Subclasses:   org.ddsteps.spring.DdSpringTestCase,
DDStepsSpringTestCase
abstract public class DDStepsSpringTestCase extends AbstractDependencyInjectionSpringContextTests implements DdTestCaseHooks(Code)
Spring Dependency Injection TestCase that is data driven.

You need the following stuff in your context:

By default, a context xml file called "ddsteps-context.xml" in the root of your classpath.

By default, the context is only loaded once, so you can probably use the same context for all your test, even if you don't happen to need a datasource in every test.

Known drawbacks when using this class:

  • The test case count is not correct, as the behaviour is not available until after setup, so it just returns 1.

author:
   Adam Skogman
since:
   1.1
version:
   $Id$


Field Summary
final public static  StringDEFAULT_BEAN_NAME_DATA_LOADER
    
final public static  StringDEFAULT_CONTEXT_XML
     Constant: The default spring context loaded by DDSteps.
 DdBehaviourbehaviour
     Delegate: The Behaviour delegate.
final protected  DdBehaviourCallbackHandlercallbackHandler
     Inner class, will simply delegate all calls back to the parent.
 StringfullName
     Property: The FULL name of this data driven testcase, i.e.

Constructor Summary
public  DDStepsSpringTestCase()
     Force a default constructor, so that subclasses don't have to mess with the name.

Method Summary
final public  intcountTestCases()
    
 DdBehaviourgetBehaviour()
     Get the behaviour for this instance.
protected  String[]getConfigLocations()
     Default is to load the context from ddsteps-config.xml in the root of the classpath.
protected  StringgetDataLoaderBeanName()
     Subclasses may override this if they don't want their DataLoader pulled from the context by the name of "dataLoader".
public  StringgetName()
     Returns the FULL data driven testcase name.
final protected  voidonSetUp()
     When we get here, the dependency injection will have happened.
final protected  voidonTearDown()
    
final public  voidrun(TestResult result)
     Override, delegates to behaviour.
final public  voidsetName(String name)
     Overrides the name setter.
public  voidsetUpAfterData()
     Override this in your subclass, if desired.
public  voidsetUpBeforeData()
     Override this in your subclass, if desired.
public  voidsetUpMethod()
     Override this in your subclass, if desired.
final  voidsuperSetUp()
     Expose the setUp in the superclass for DdBehaviour callback to use.
final  voidsuperTearDown()
     Expose the tearDown in the superclass for DdBehaviour callback to use.
public  voidtearDownAfterData()
     Override this in your subclass, if desired.
public  voidtearDownBeforeData()
     Override this in your subclass, if desired.
public  voidtearDownMethod()
     Override this in your subclass, if desired.

Field Detail
DEFAULT_BEAN_NAME_DATA_LOADER
final public static String DEFAULT_BEAN_NAME_DATA_LOADER(Code)
Constant: The default bean name for your DataLoader



DEFAULT_CONTEXT_XML
final public static String DEFAULT_CONTEXT_XML(Code)
Constant: The default spring context loaded by DDSteps.



behaviour
DdBehaviour behaviour(Code)
Delegate: The Behaviour delegate.

This will not be dependency injected by default, as there is no setter and the field is not protected.

Always get the behaviour using the getBehaviour() method.




callbackHandler
final protected DdBehaviourCallbackHandler callbackHandler(Code)
Inner class, will simply delegate all calls back to the parent. Needed since setUp() and tearDown() are not public in Springs testcase.



fullName
String fullName(Code)
Property: The FULL name of this data driven testcase, i.e. testMethod[Row 13] if a row instance.




Constructor Detail
DDStepsSpringTestCase
public DDStepsSpringTestCase()(Code)
Force a default constructor, so that subclasses don't have to mess with the name. JUnit will always call setName(), well, TestSuite will do that actually.




Method Detail
countTestCases
final public int countTestCases()(Code)

See Also:   junit.framework.Test.countTestCases



getBehaviour
DdBehaviour getBehaviour()(Code)
Get the behaviour for this instance. The behaviour is cached, once loaded.

When getting the behaviour, the dataloader will be looked up from the spring context. A behaviour, never null.




getConfigLocations
protected String[] getConfigLocations()(Code)
Default is to load the context from ddsteps-config.xml in the root of the classpath.
See Also:   org.springframework.test.AbstractDependencyInjectionSpringContextTests.getConfigLocations



getDataLoaderBeanName
protected String getDataLoaderBeanName()(Code)
Subclasses may override this if they don't want their DataLoader pulled from the context by the name of "dataLoader". Bean name of the DataLoader.



getName
public String getName()(Code)
Returns the FULL data driven testcase name. A string, null if setName() has not been called.



onSetUp
final protected void onSetUp() throws Exception(Code)
When we get here, the dependency injection will have happened.
See Also:   org.springframework.test.AbstractDependencyInjectionSpringContextTests.onSetUp



onTearDown
final protected void onTearDown() throws Exception(Code)

See Also:   org.springframework.test.AbstractDependencyInjectionSpringContextTests.onTearDown



run
final public void run(TestResult result)(Code)
Override, delegates to behaviour.
See Also:   junit.framework.Test.run(junit.framework.TestResult)



setName
final public void setName(String name)(Code)
Overrides the name setter. Behaviour is cleared when name is reset.
See Also:   junit.framework.TestCase.setName(java.lang.String)



setUpAfterData
public void setUpAfterData() throws Exception(Code)
Override this in your subclass, if desired.
throws:
  Exception -
See Also:   org.ddsteps.junit.behaviour.DdBehaviourCallbackHandler.setUpAfterData



setUpBeforeData
public void setUpBeforeData() throws Exception(Code)
Override this in your subclass, if desired.
throws:
  Exception -
See Also:   org.ddsteps.junit.behaviour.DdBehaviourCallbackHandler.setUpBeforeData



setUpMethod
public void setUpMethod() throws Exception(Code)
Override this in your subclass, if desired.
throws:
  Exception -
See Also:   org.ddsteps.junit.behaviour.DdBehaviourCallbackHandler.setUpMethod



superSetUp
final void superSetUp() throws Exception(Code)
Expose the setUp in the superclass for DdBehaviour callback to use.
throws:
  Exception -



superTearDown
final void superTearDown() throws Exception(Code)
Expose the tearDown in the superclass for DdBehaviour callback to use.
throws:
  Exception -



tearDownAfterData
public void tearDownAfterData() throws Exception(Code)
Override this in your subclass, if desired.
throws:
  Exception -
See Also:   org.ddsteps.junit.behaviour.DdBehaviourCallbackHandler.tearDownAfterData



tearDownBeforeData
public void tearDownBeforeData() throws Exception(Code)
Override this in your subclass, if desired.
throws:
  Exception -
See Also:   org.ddsteps.junit.behaviour.DdBehaviourCallbackHandler.tearDownBeforeData



tearDownMethod
public void tearDownMethod() throws Exception(Code)
Override this in your subclass, if desired.
throws:
  Exception -
See Also:   org.ddsteps.junit.behaviour.DdBehaviourCallbackHandler.tearDownMethod



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