Java Doc for InterfaceTestCase.java in  » Test-Coverage » GroboUtils » net » sourceforge » groboutils » junit » v1 » iftc » 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 » Test Coverage » GroboUtils » net.sourceforge.groboutils.junit.v1.iftc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase

All known Subclasses:   net.sourceforge.groboutils.pmti.v1.autodoc.v1.server.AbstractNewFileServerUTestI,  net.sourceforge.groboutils.codecoverage.v2.IClassChannelLogReaderUTestI,  net.sourceforge.groboutils.autodoc.v1.testserver.MonitorUTestI,  net.sourceforge.groboutils.mbtf.v1.IErrorsUTestI,  net.sourceforge.groboutils.pmti.v1.defimpl.AbstractEditableIssueUTestI,  net.sourceforge.groboutils.codecoverage.v2.IMethodCodeUTestI,  net.sourceforge.groboutils.pmti.v1.defimpl.AbstractEditableAttributeUTestI,  net.sourceforge.groboutils.pmti.v1.IEditableAttributeUTestI,  net.sourceforge.groboutils.uicapture.v1.IScriptMakerUTestI,  net.sourceforge.groboutils.pmti.v1.itf.IIssueRecordUTestI,  net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataWriterUTestI,  net.sourceforge.groboutils.pmti.v1.IIssueUTestI,  net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordSetUTestI,  net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordUTestI,  net.sourceforge.groboutils.pmti.v1.autodoc.v1.server.AbstractAppendFileServerUTestI,  net.sourceforge.groboutils.pmti.v1.itf.parser.IParserGeneratorUTestI,  net.sourceforge.groboutils.autodoc.v1.spi.TestListenerFactoryUTestI,  net.sourceforge.groboutils.pmti.v1.IAttributeSetUTestI,  net.sourceforge.groboutils.autodoc.v1.testserver.TestDataUTestI,  net.sourceforge.groboutils.codecoverage.v2.datastore.IClassMetaDataWriterUTestI,  net.sourceforge.groboutils.pmti.v1.defimpl.AbstractEditableListAttributeUTestI,  net.sourceforge.groboutils.codecoverage.v2.datastore.IClassMetaDataReaderUTestI,  net.sourceforge.groboutils.pmti.v1.IEditableIssueStateUTestI,  net.sourceforge.groboutils.pmti.v1.autodoc.v1.ITFFactoryUTestI,  net.sourceforge.groboutils.pmti.v1.IListAttributeUTestI,  net.sourceforge.groboutils.autodoc.v1.AutoDocITUTestI,  net.sourceforge.groboutils.autodoc.v1.testserver.AbstractWriterServerUTestI,  net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordWriterUTestI,  net.sourceforge.groboutils.pmti.v1.IProblemManagerInfoUTestI,  net.sourceforge.groboutils.junit.v1.iftc.ImplFactoryUTestI,  net.sourceforge.groboutils.pmti.v1.itf.parser.IParserUTestI,  net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaDataUTestI,  net.sourceforge.groboutils.autodoc.v1.testserver.TestDataFactoryUTestI,  net.sourceforge.groboutils.pmti.v1.itf.impl.AbstractTestIssueRecordCollatorUTestI,  net.sourceforge.groboutils.pmti.v1.IAttributeUTestI,  net.sourceforge.groboutils.junit.v1.iftc.Sample3IUTestI,  net.sourceforge.groboutils.junit.v1.iftc.Sample4IUTestI,  net.sourceforge.groboutils.autodoc.v1.spi.AutoDocFactoryUTestI,  net.sourceforge.groboutils.codecoverage.v2.datastore.IMetaDataReaderUTestI,  net.sourceforge.groboutils.pmti.v1.defimpl.AbstractIssueUTestI,  net.sourceforge.groboutils.pmti.v1.IAttributeInfoUTestI,  net.sourceforge.groboutils.junit.v1.iftc.ICxFactoryUTestI,  net.sourceforge.groboutils.pmti.v1.IIssueTypeInfoUTestI,  net.sourceforge.groboutils.autodoc.v1.junit.AutoDocJUnitListenerUTestI,  net.sourceforge.groboutils.pmti.v1.IEditableListAttributeUTestI,  net.sourceforge.groboutils.autodoc.v1.defimpl.IAutoDocSetUTestI,  net.sourceforge.groboutils.pmti.v1.itf.ITestIssueRecordCollatorUTestI,  net.sourceforge.groboutils.pmti.v1.IProblemManagerUTestI,  net.sourceforge.groboutils.autodoc.v1.testserver.ServerUTestI,  net.sourceforge.groboutils.util.classes.v1.IUrlClassLoaderOnlineUTestI,  net.sourceforge.groboutils.pmti.v1.itf.parser.IParserCollatorUTestI,  net.sourceforge.groboutils.autodoc.v1.AutoDocTPUTestI,  net.sourceforge.groboutils.junit.v1.iftc.Sample1IUTestI,  net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerUTestI,  net.sourceforge.groboutils.autodoc.v1.testserver.junit.JUnitTestListenerUTestI,  net.sourceforge.groboutils.autodoc.v1.testserver.TestCorrelateUTestI,  net.sourceforge.groboutils.pmti.v1.itf.parser.AbstractParserUTestI,  net.sourceforge.groboutils.util.classes.v1.IUrlClassLoaderUTestI,  net.sourceforge.groboutils.codecoverage.v2.IAnalysisModuleUTestI,  net.sourceforge.groboutils.autodoc.v1.testserver.MonitorFinderUTestI,  net.sourceforge.groboutils.pmti.v1.IEditableAttributeSetUTestI,  net.sourceforge.groboutils.codecoverage.v2.IChannelLogRecordUTestI,  net.sourceforge.groboutils.codecoverage.v2.IChannelLogReaderUTestI,  net.sourceforge.groboutils.autodoc.v1.AutoDocLogUTestI,  net.sourceforge.groboutils.autodoc.v1.testserver.TestInfoUTestI,  net.sourceforge.groboutils.autodoc.v1.spi.AutoDocITFactoryUTestI,  net.sourceforge.groboutils.pmti.v1.IIssueStateUTestI,  net.sourceforge.groboutils.pmti.v1.itf.ITestRecordUTestI,  net.sourceforge.groboutils.autodoc.v1.spi.AutoDocTPFactoryUTestI,  net.sourceforge.groboutils.autodoc.v1.spi.AutoDocLogFactoryUTestI,  net.sourceforge.groboutils.junit.v1.parser.ITestCreatorUTestI,  net.sourceforge.groboutils.junit.v1.iftc.Sample2IUTestI,  net.sourceforge.groboutils.codecoverage.v2.IChannelLoggerFactoryUTestI,  net.sourceforge.groboutils.codecoverage.v2.report.IReportGeneratorUTestI,  net.sourceforge.groboutils.pmti.v1.IEditableIssueUTestI,  net.sourceforge.groboutils.util.throwable.v1.IChainableExceptionUTestI,
InterfaceTestCase
abstract public class InterfaceTestCase extends TestCase (Code)
A subclass of TestCase to ease the requirements of creating an interface test. The tests should be thought of as "contract tests". Subclasses can call createImplObject() to create a new instance of a subclass of interfaceClass, which is generated from the ImplFactory passed into the constructor.

Subclasses that want to use the InterfaceTestSuite helper class will need to specify a constructor similar to:

 public MyClassTest( String name, ImplFactory f )
 {
 super( name, MyClass.class, f );
 }
 
where MyClass is the interface or base class under test.

As of October 30, 2002, the InterfaceTestCase has a slightly different behavior when the factory instance is an implementation of ICxFactory. In this scenario, it will store all the instantiated objects in the stack, and each instantiated object will be passed to the ICxFactory instance during the test's normal tearDown. If the ICxFactory throws an exception during any of the tearDown calls, they will be stored up and reported in a single exception. Therefore, if you want this functionality, then you will need to ensure that your tearDown() method calls the super tearDown().

Even though JUnit 3.8+ allows for a TestCase to have a default (no-arg) constructor, the InterfaceTestCase does not support this. The benefits simply aren't there for interface tests: they will still have to create a constructor which passes InterfaceTestCase which class is being tested. Since a constructor is required anyway, the little extra effort to add two arguments to the constructor and call to the super is trivial compared to not needing the constructor at all.

As of 08-Dec-2002, the returned name of the test can include the class's name, without the package, to improve traceability. This will allow the user to be able to see in which specific test class an error occured through the Ant JUnit report mechanism. This is enabled by default, but can be disabled by setting the Java system-wide property "net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase.no-classname" to true, which is dynamically checked at runtime at each call.
author:
   Matt Albrecht groboclown@users.sourceforge.net
version:
   $Date: 2003/02/10 22:52:20 $
since:
   March 2, 2002
See Also:   ImplFactory
See Also:   ICxFactory
See Also:   InterfaceTestSuite



Field Summary
final static  StringDONT_USE_CLASSNAME
    

Constructor Summary
public  InterfaceTestCase(String name, Class interfaceClass, ImplFactory f)
     The standard constructor used by JUnit up to version 3.7.

Method Summary
public  ObjectcreateImplObject()
     Calls the stored factory to create an implemented object.
public  ClassgetInterfaceClass()
     Return the interface or abstract class this test covers.
public  StringgetName()
     Override the TestCase default getName so that the factory names are returned as well.
public  Stringname()
     Ensure, for JUnit 3.7 support, that the original name() method is still supported.
public  voidsetUseClassInName(boolean use)
     Sets whether the classname is put in the output or not.
protected  voidtearDown()
     Send each instantiated object to the factory for cleanup.

Field Detail
DONT_USE_CLASSNAME
final static String DONT_USE_CLASSNAME(Code)




Constructor Detail
InterfaceTestCase
public InterfaceTestCase(String name, Class interfaceClass, ImplFactory f)(Code)
The standard constructor used by JUnit up to version 3.7.
Parameters:
  name - the name of the test to execute.
Parameters:
  interfaceClass - the class which this test case tests.
Parameters:
  f - the factory which will create specific subclass instances.




Method Detail
createImplObject
public Object createImplObject()(Code)
Calls the stored factory to create an implemented object. Subclasses should make their own method, say getObject(), which returns this method's result, but casted to the right class.

This method makes an assertion that the factory's created object is not null, so that the system state is ensured. Therefore, this method will never return null. Also, this method asserts that the created object is of the correct type (as passed in through the constructor), so that it can be correctly cast without errors. the object created by the factory.




getInterfaceClass
public Class getInterfaceClass()(Code)
Return the interface or abstract class this test covers. the interface under test.



getName
public String getName()(Code)
Override the TestCase default getName so that the factory names are returned as well. the method name being tested, along with the factory'sname.



name
public String name()(Code)
Ensure, for JUnit 3.7 support, that the original name() method is still supported. getName().



setUseClassInName
public void setUseClassInName(boolean use)(Code)
Sets whether the classname is put in the output or not. If you don't set this value here, it will use the value of the system property described above.
since:
   03-Dec-2002



tearDown
protected void tearDown() throws Exception(Code)
Send each instantiated object to the factory for cleanup.
exception:
  Exception - thrown if the super's tearDown throws anexception, or if any exceptions are thrown during the tear-downof the factory generated instances.



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